This is a migrated thread and some comments may be shown as answers.

ReportName

3 Answers 249 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 14 May 2007, 05:00 PM
In the examples that are installed, the ReportViewer.aspx file has a ReportName variable in the URL.  For example:
http://localhost/Telerik/Reporting1.0/examples/vb/webdemo/ReportViewer.aspx?ReportName=GroupReport%2c+VB.ReportLibrary%2c+Version%3d1.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3dnull

How do you come up with the value for the ReportName variable?  In my solution, I have a report filename (w/ the same classname) called BudgetsByRegion.vb in my App_Code directory.  What would the ReportName value be in my situation?

Chris

3 Answers, 1 is accepted

Sort by
0
Chavdar
Telerik team
answered on 15 May 2007, 11:54 AM
Hi Chris,

To see the report at  runtime you have to instantiate it and set its instance to the Report property of the Report Viewer. For example:

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Me.ReportViewer1.Report = New BudgetsByRegion()
    End Sub


The ReportName solution is a custom solution applicable just for the examples.
 

Greetings,
Chavdar
the Telerik team

nstantly find answers to your questions at the new Telerik Support Center
0
Chris
Top achievements
Rank 1
answered on 15 May 2007, 03:34 PM
So is there any way to build a dynamic reporting web application where you pass a value to a page and have it display the report corresponding to the value?  If I use your code, I have to statically define every report in the ReportViewer.aspx file which isn't optimal and would be a nightmare to maintain especially when we're talking about 1000 reports or more.

Chris
0
Chavdar
Telerik team
answered on 15 May 2007, 04:13 PM
Hi Chris,

In this case you may try the approach used in the Reporting examples, but modified to your needs. The ReportName actually is the AssemblyQualifiedName of the type which is used later to instantiate the actual report instance. It can be taken using the following code snippet:

    Dim reportNameValue As String =
         Server.UrlEncode(New BudgetsByRegion().GetType().AssemblyQualifiedName)


To see exactly how this is implemented in the Reporting Examples, you can open the sample VB.NET solution which is installed with the Reporting tool. There you can find exactly how the dynamic report handling is implemented. The most important code is located in the code-behind of Default.aspx, ReportViewer.aspx from the Web Site project and ReportExplorer.vb from the VB.ReportLibrary project.

 
Best wishes,
Chavdar
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
General Discussions
Asked by
Chris
Top achievements
Rank 1
Answers by
Chavdar
Telerik team
Chris
Top achievements
Rank 1
Share this question
or