Telerik Forums
Reporting Forum
1 answer
127 views
For anyone else out there that's been struggling with getting dynamic connection strings working with Telerik Reporting in their Website (as opposed to Web Application), here's a great trick I finally figured out:

1.  Design the report according to the "Best Practices" in a seperate class project, using a data source that gives you a good representative sample of data.  Get the report looking just the way you want it.

2.  In your Website project, add a new page for displaying the report.

3.  Add a ReportViewer to the new page in your Website project (as described in the "How To: Add report viewer to a Web page" in the Telerik Reporting Q1 2012 documentation).

4.  In the Page_Load event of your new Website project page, instantiate a Report variable as described in the "Programmatic Control of Reports" section of the "Telerik Reporting Q1 2012" documentation (MyReport report = new MyReport();).

5.  Back in your seperate report class project, locate the .cs file for your report in the Solution Explorer and click the "+" symbol to expand it.  Open the .Designer.cs file you see there.

6.  In the Designer.cs file, copy the code within the InitializeComponent() priviate void.  Flip back over to your Website project and paste this code below the instantiation of your Report variable (in the Page_Load event of your new page).

7.  Everywhere in your pasted code you find "this", replace it with your Report variable.

8.  At the end of the report creation code you just pasted and tweaked, work your data access magic and set your report's .DataSource property to the DataTable that results from your data access magic.  (I have a custom class that executes stored procedures with connections strings that vary based on logged-in user.  The need to use this is what prompted this investigation and the solution I am describing here.)

9.  Set the .Report property of the ReportViewer on your new page to the Report variable.

Voila!  You now have a Telerik Reporting report, designed with the slick, easy-to-use Report Designer and tightly integrated into your Website project using the same data access methodology you used for your grids, pages, combo boxes, etc. used elsewhere in your Website project!

The posts in this forum have helped me save a lot of time over the years.  I hope this "gives back" and helps many others get through this sticky problem a lot quicker than I did.

Best,

- Russ
Raja
Top achievements
Rank 1
 answered on 16 Aug 2015
2 answers
688 views

I am trying to bind a TextBox to an a dynamically named column using expressions.

var textBoxHistorical = new TextBox
{
    Name = "myTextBox",
    Value = "= Fields.[" + ​dynamicColumnName+ "_​Average])",
    Size = new SizeU(Unit.Pixel(100), Unit.Pixel(20)),
    Location = new PointU(Unit.Pixel(0), Unit.Pixel(0))
};

The column name can have ugly characters like \/*[]:?|-+@#$$^&()_,.!3. When I try to bind to Fields.[\/*[]:?|-+@#$$^&()_,.!3_​Average], I get an error like

     Cannot interpret token '\' at position 13.

I tried escaping the slash with another slash, and got the same error. How do I escape characters in an expression? Which characters do I need to escape? I figure I need to escape the closing bracket also, but trial by error is probably not the best way to solve the problem.

John
Top achievements
Rank 1
 answered on 14 Aug 2015
1 answer
54 views
How can i use globalization in report parameters .. as i m passing urdu string to parameter value but show no record against this value 
here's my code please help me 
   

          string urduValue = "پیپل کالونی تھانہ";
            m.ReportParameters[0].Value = urduValue.ToString();
            m.ReportParameters[1].Value = "0";
            m.ReportParameters[2].Value = "0/15";
            reportViewer1.ReportSource = m;
            reportViewer1.RefreshReport();
Nasko
Telerik team
 answered on 14 Aug 2015
3 answers
549 views
Hello,

I have a problem with the HtmlTextBox in the Report Designer .

The following value I entered in the Edit Expression window in HTML View :

<p style="margin: 0px">Hello,... here is the first row<br />Hello,... <span style="color: #800080">here is</span> the <strong>second </strong>row<br />Hello,... here is the last r<span style="text-decoration: underline">ow</span></p><p style="margin: 0px">dvwerfvewrv</p>

In Design View in the Edit Expression window is the Content correct. No free spaces after paragraphs.

In the report designer clearances are displayed after each paragraph .

In all of the controls that I have tested , begin any new rows with the < P > < / P > and not with <br /> . Us as a software manufacturer would be helped if between the paragraphs in the report is not in the blanks would be seen . Currently you can in style margin : 0px; define , but has no effect. How can we be helped ? All other tags work clean , only the margin between the paragraphs not .
Nasko
Telerik team
 answered on 14 Aug 2015
1 answer
76 views

Hi,

 when I print a ​report (created with C# WPF) with a PDF-Printer like "7-PDF Printer", I will get an image of the report in the pdf file.

Is there any way to get text and images in the pdf?

 

Thx

Ellis
Top achievements
Rank 1
 answered on 13 Aug 2015
2 answers
427 views

Hi, I'm trying out your reporting suite, but I've encountered a small issue while trying with user defined functions. I created a simple function, compiled and moved the DLL to the report designer folder and added the Assembly References and it's working properly.

The problem comes when I try to load the report in the report designer as an UriReportSource in my VB.net application. The textbox containing the function says "The expression contains object 'xxxx' that is not defined in the current context.".

Could you please point me in the right direction to overcome this issue. Any help will be greatly appreciated.

Ellis
Top achievements
Rank 1
 answered on 13 Aug 2015
1 answer
236 views

I was able to find the thread below on how to add a list of the parameters used in the multi select to the header using C# but I couldn't find a way to make it work in the report designer. 

http://www.telerik.com/forums/show-multi-select-parameter-values-in-header

How would I go about making this work in the Report Designer?

Nasko
Telerik team
 answered on 13 Aug 2015
3 answers
883 views

 Please Resolve my problems with Reporting.

1.How to set Dataset  or datatable as Datasource to a Report.

2. set number of records per page

3.Sub Reports in Main Report.

Stef
Telerik team
 answered on 12 Aug 2015
12 answers
1.2K+ views
It seems if I click on the refresh button in the Report Viewer toolbar it will re-render the current data on the screen.  How do I connect to that button so that it grabs the latest data from the database and renders it?   Right now my QA person is hand editing the DB while testing our tool and expected the refresh button to show the changes from the DB.  Is there a method I need to implement to handle this in my C# code?

Thanks,

John
Saumyadip
Top achievements
Rank 2
 answered on 12 Aug 2015
7 answers
519 views
Helo,
I just want to ask what if i want to filter my results in my database query at runtime? That is, if i have a option on one page to select 'From DateTime' and 'To Datetime' and click generate report, then how would i pass that arguments to 'Something_NeedDataSource' event so that parameters can be given to my query at runtime? Is there any other wayt to accomplish it so please let me know.
Thank you
Saumyadip
Top achievements
Rank 2
 answered on 12 Aug 2015
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?