.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Post New Web Links

SPFeatureReceiver: Creating report viewer web part programmatically

Posted By:      Posted Date: October 10, 2010    Points: 0   Category :SharePoint
 

I have a feature that adds a report viewer web part (SP integrated mode) into the newly created site page.

Problem: The feature activates without any problem through the UI, but I cannot activate it through STSADM (which will be the case when going to production).

Here is my code block that adds the web part to the page. This code block exists in FeatureActivated:

Assembly currentAssembly = Assembly.GetExecutingAssembly();
string dwpStr = string.Empty;

try
{
    using (Stream resourceStream = currentAssembly.GetManifestResourceStream("Report.dwp"))
    {
        using (StreamReader sr = new StreamReader(resourceStream))
        {
            dwpStr = sr.ReadToEnd();
            dwpStr = string.Format(dwpStr, web.Url);
            sr.Close();
        }
        resourceStream.Close();
    }

    using (StringReader sr = new StringReader(dwpStr))
    {
        string err = string.Empty;
        System.Web.UI.WebControls.WebParts.WebPart wp = wpMan.ImportWebPart((XmlReader.Create(sr as TextReader)), out err); //Exception thrown from this line
        wpMan.AddWebPart(wp, "HeaderZone", 0);
    }
}
catch (Exception ex)
{
    //Log errors
}
Report.dwp is as follows:
<?xml version="1.0" encoding="utf-8"?>
<WebPart xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&q


View Complete Post


More Related Resource Links

Best Practice for connect SSRS Report Viewer Web part with custom filter web part (With Dropdown\Lis

  

To make a filter provider web part, I implemented the interface ITransformableFilterValues.
Implemented the various properties of the ITransformableFilterValues interface
and method that creates an instance of our filter provider.

[aspnetwebparts.ConnectionProvider("AccountFilter", "ITransformableFilterValues", AllowsMultipleConnections = true)]
public ITransformableFilterValues SetConnectionInterface()
{
return this;
}

Is this a best practice .Please share your suggestion.

Regards,
Prashob


Best Practice for connect SSRS Report Viewer Web part with custom filter web part (With Dropdown\Lis

  

To make a filter provider web part, I implemented the interface ITransformableFilterValues.
Implemented the various properties of the ITransformableFilterValues interface
and method that creates an instance of our filter provider.

[aspnetwebparts.ConnectionProvider("AccountFilter", "ITransformableFilterValues", AllowsMultipleConnections = true)]
public ITransformableFilterValues SetConnectionInterface()
{
return this;
}

Is this a best practice .Please share your suggestion.

Regards,
Prashob


Can I "hard-code" a particular report in the report viewer web part?

  

Hi there,

I am wondering if it is possible to "hard-code" a particular report in the report viewer web part, such that this report is automatically loaded when a user visits a particular site. I am asking that question because I do not want to select the same report each time I want to view it; I just would like to have a link that will get me the report right away.

Best wishes

Oliver

 


Report viewer web part: Dependency of parameter choices on user rights?

  

Hi there,

I am wondering if it is possible to restrict the choices for a parameter depending on the user rights. For instance, if an "administrator" can select three different options for one particular parameter, a "normal user" should only be able to choose from two.

I am using Sharepoint 2007 and Reporting Services 2005.

Best wishes

Oliver

 


Report Viewer Web Part - MOSS 2007

  

 

Hi

     I am working with the Report Viewer webpart on sharepoint 2007 to display reports from another server (native reports). So now i am showing around 4 RS reports on the sharepoint site side by side. The reports seem to appear fine.

 

Now when i try to change the title of the Report Viewer webpart to display the name of the report it just dosent seem to change for more than one. Every time i click 'Modify Shared Webpart' the title of the report viewer webpart reverts back to the default 'Report Viewer'.

 

I also tried opening the sharepoint page using the 'Sharepoint Designer'. The titles seem to reflect the entries i have entered. But the titles just dont appear on the sharepoint page.

 

I have been trying to figure out if there is some autogeneration of webpart titles taking place but just cant seem to figure that out. Any help would be greatly appreciated as i have been stuck on this for quite some time.

 

 

 

 

Thanks

Sriraag

 


How To disable Export Format in Dropdown List of report viewer web part?

  

hi,

does any one knows how to disable the export option in the dropdown list of report viewer web part?

thnx


How to import SQL Server Reporting Services Report Viewer Webpart on web part Page using code in Sha

  

Hi Every One,

I have use SQL Server Reporting Service in SharePoint integrated mode. I have deployed all reports and data source in SharePoint Document Library using CODE. I need to show those report in “SQL Server Reporting Services Report Viewer” Web Part on Web Part Page, I have created Web Part page by code. But I cannot import this Web Part on Page using Code.

How I can do this by code.

 


Navaratan Sharma

Report Viewer - Web Part Preview Error

  

Report viewer web part preview is showing the following error

Microsoft SQL Server Reporting Services
ErrorError
This web part has not been configured correctly. Please contact the document owner.

I have to resolve this error to customize the report viewer.  How to resolve this error


Dhanapal Chinnusamy

how to use Report viewer and report Explorer web part in sharepont 2007 for ssrs

  

i have to show ssrs report in the sharepoint 2007 using report viewer and report explorer how to user this two web part to get the ssrs report in sharepoint 2007.

i am new to the ssrs with sharepoint 2007.

 


Custom Multi Filter Web Part for Report Viewer

  
I want to create a custom web part that has more than 1 filter web part and that can be connected to Report Viewer Web Part (Integrated Mode) at runt time/design time.

I searched a lot but could not find a way to have single web part that is a provider to more than 1 filters.
Say for example -
  1. My Report accept 2 parameter Department and Region. 
  2. I want to connect both parameter with single web part having two drop down (one for Department and one for Region)
  3. Values from both the drop down should be passed to Department and Region
  4. Report should be rendered in Report Viewer Web Part

Solution Tried so far
  1. Create a web part that adds two custom drop down
  2. Custom Drop down class that Implements from ITransformableFilterValues
  3. Have 2 Methods on the web pat each having ConnectionProvider Attribute and return instance of drop down control
Problem:
  1. Even though 2 connection option is shown on my custom filter web part only one can be added
  2. For example - If I connect Filter1(custom web part) to Department then i am unable to connect to Report Viewer web part again.
     
My web part have methods like this 
     

Creating Dataset Dynamically in c# and passing to Report Viewer..

  

Hi,

 It sounds silly!! but i can't figure out how to get the data to the report viewer from the dataset that i have created in c#. because my dataset is dynamic and the columns would vary every time when i load into the report viewer. i read thru most of the articles but was unable to figure houw to work this out.

the data set for eg i created is:-

 

private DataSet getDataSet()
{
   string sql = "";
   sql += "SELECT * FROM TABLE WHERE NAME='JOHN SMITH'";
   OdbcDataAdapter adptr = new OdbcDataAdapter(sql, _connection); 
   DataSet ds = new DataSet();
   adptr.Fill(ds);
   return ds;
}

and from this dataset i have to create the report viewer. this is created in cs page of the aspx page where the report viewer is. also i have a blank report.rdlc. please help me thru this...

thanks in advance..

Tenny

 


Creating an Excel Spreadsheet programmatically using VB.NET

  
The Interoperability services make it very easy to work with COM Capable Applications such as Word and Excel. This article reveals using Excel from a managed application. Excel is the spreadsheet component of Microsoft Office 2000. The majority of Excel programmatic functionality is exposed through Automation via the type library Excel9.olb. The intention of this article is to express that a managed application can interrelate with Excel as a COM server.

Creating an Excel Spreadsheet and Adding Data to It Programmatically

  
The Interoperability services make it veryeasy to work with COM Capable Applications such as Word and Excel. Thisarticle reveals using Excel from a managed application. Excel is thespreadsheet component of Microsoft Office 2000. The majority of Excelprogrammatic functionality is exposed through Automation via the typelibrary Excel9.olb. The intention of this article is to express that amanaged application can interrelate with Excel as a COM server.

Creating a Basic SharePoint Web Part

  
This programming task includes the steps for creating a basic custom Windows SharePoint Services Web Part. It is a simple Web Part that allows you to change the Web Part's Title property, which is a Windows SharePoint Services WebPart base class property that sets the text in the title bar of the Web Part.

How to use report viewer 2010 in VS 2008

  

I downloaded report viewer 2010 from here

http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=a941c6b2-64dd-4d03-9ca7-4017a0d164fd


Now I want to actually use it in a website.  How do I do that?  Do I have to modify some part of web.config?  Specifically, what do I need to change?


Thanks




populate report viewer by code

  

Hi all

I have a button "Show Report" to show some data from table

what I should write under this button to populate the reports ?


Report viewer error

  



  • An error has occurred during report processing.
    • A data source instance has not been supplied for the data source "PatientDetailsReport_DataTable1".




  • i am using two to three rdlc reports in my page for single report viewer when i first load the page i got the output in reportviewer but when i try to load other rdlc report then am getting the above mentioned error.i cleared all the datasources for the report viewer before giving new datasource but am getting the same error pls someone help



Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend