Telerik Forums
Reporting Forum
1 answer
280 views

Hello Telerik Team,

I'm find it difficult to pass a report parameter value from the client side and access the particular value within the Telerik report class.

cshtml code.

@{
        TypeReportSource typeReportSource = new TypeReportSource() { TypeName = typeof(TestTelerik.Website.Reports.MySales).AssemblyQualifiedName };
        typeReportSource.Parameters.Add("param", "A");
    }
     
    @(Html.TelerikReporting().ReportViewer()
    .Id("reportViewer1")
    .ServiceUrl(Url.Content("~/api/reports/"))
    .TemplateUrl(Url.Content("~/ReportViewer/templates/telerikReportViewerTemplate-9.1.15.624.html"))
    .ReportSource(typeReportSource)
    .ViewMode(ViewMode.Interactive)
    .ScaleMode(ScaleMode.Specific)
    .Scale(1.0)
    .PersistSession(false)
    .PrintMode(PrintMode.AutoSelect)
    .Deferred()

 

I have defined a method to trigger NeedDataBind event which is as follows.

private void ProductReport_NeedDataSource(object sender, EventArgs e)
{
      var myParam = this.ReportParameters["param"].Value.ToString();
}

 

Also i have defined report parameter as follows. However, this.ReportParameters["param"].Value is always null. Could I know what am I doing wrong in my code.

reportParameter1.Name = "param";
this.ReportParameters.Add(reportParameter1);

Stef
Telerik team
 answered on 18 Aug 2015
1 answer
636 views
Can you or can you not convert/import RDLC reports?
Stef
Telerik team
 answered on 18 Aug 2015
2 answers
109 views

We have a report with a Multivalue parameter.  We use the WebForms ReportViewer control to allow the user to make a selection before running the report.  We have noticed that, when certain combinations of selections are made, if the user selects out of the combobox and selects back into it, some of their selections are lost.  It is always the same selections that get lost.

I have checked the datasource that the multivalue parameter is bound to and there are no duplicate IDs in the list of values. 

Are there any known issues with the ReportViewer control and multivalue comboboxes that might explain why certain selections can get unselected?

Paul
Top achievements
Rank 1
 answered on 17 Aug 2015
1 answer
121 views

Hi,

I need to display 2 subreports side by side on a report.

The first one contain a table object with a variable columns number base on the data it need to show. That part is working ok.

The second subreport is fixed in width and must be place right of the first with a 1 cm space between them.

The problem I'm having, is that we need to center horizontally that subreports block.

I can't find a way to get the subreport1 width after it is rendered so I have the processed width not the design time one.

How can I do this? With code? And if so, any example of code?

Thank you.

​​

Stef
Telerik team
 answered on 17 Aug 2015
2 answers
730 views

Hi,

 I have abandoned tables due to grouping issues and am now using textboxes and report groups.  In a group header, I have 5 texboxes which all have CanGrow set to True.

The problem is that when one text box grows in height, the others stay the same size.  I would like all textboxes to be the same height after the report renders.  So if one text box has to grow, the others should grow to that same size.

I tried to use anchoring, but I have textboxes above and below so they end up overlapping if I anchor them.

Is there anyway to get all texboxes in a group to grow in height dynamically depending on the size of the largest?

 Thanks,

Phillip

Phil
Top achievements
Rank 1
 answered on 17 Aug 2015
1 answer
116 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
653 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
45 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
509 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
57 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
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?