Telerik Forums
Reporting Forum
1 answer
142 views
I have created a telerik report useing textboxes and a subreport.  When I export it to a docx all the controls are exported to the docx.  I would like the text only to come over when exported.  Following is the code i use to export:

Telerik.Reporting.Processing.ReportProcessor TelContractrp = new Telerik.Reporting.Processing.ReportProcessor();
            System.Collections.Hashtable deviceInfo = new System.Collections.Hashtable();
            Telerik.Reporting.InstanceReportSource TelContractirs = new Telerik.Reporting.InstanceReportSource();
            TelContractirs.ReportDocument = currRpt;
            Telerik.Reporting.Processing.RenderingResult result = TelContractrp.RenderReport("DOCX", TelContractirs, deviceInfo);
            string dContract = DateTime.Now.ToString().Replace("/", "");
            dContract = dContract.Substring(0, 12);
            dContract = dContract.Replace(":", "");
            string fileName2 = result.DocumentName + "_" + dContract + "." + result.Extension;
            string filePath2 = System.IO.Path.Combine(saveLocation, fileName2);
            FileStream fs = new FileStream(filePath2, FileMode.Create);
            fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);
            fs.Close();
            System.Diagnostics.Process p = new System.Diagnostics.Process();
            p.StartInfo.UseShellExecute = true;
            p.StartInfo.FileName = filePath2;
            p.Start();
Squall
Top achievements
Rank 1
 answered on 02 Jul 2013
1 answer
88 views
I am working a on Silverlight solution using the ReportViewer and a subclass of Telerik.Reporting.Service.ReportService for the reporting service.

The report to be produce is about the same, every time, but I needed a way to provide some "parameters" from the client to the service in order to customize the report before generation.

I used the "ReportViewer.Report" property on the client side and a custom IReportResolver on the server side to transfert my information on the service side. This way, my custom IReportResolver could parse the information, instantiate and customize the report before generation.

Example:
Silverlight:
<tkr:ReportViewer  ReportServerUri="../ReportingService.svc" Report="param1=X;param2=Y;etc" />


Service:
public class MyReportingService : ReportService, IReportResolver
{
 
    public MyReportingService ()
    {
      this.ReportResolver = this;
    }
 
    ReportSource IReportResolver.Resolve( string report )
    {
      var myReport = new MyReport();
      // Here I customize the "myReport" instance based on the
      // value of the "report" parameter
      return new InstanceReportSource() { ReportDocument = myReport };
    }
}

Everything work as expected when displayed in the ReportViewer, but when the user click the "save as" button, the "ReportViewer.Report" property value is NOT the one provided to the IReportResolver. The fully qualified name of the Report class is used instead.

Do you have any suggestions to workaround this issue ?
Peter
Telerik team
 answered on 01 Jul 2013
2 answers
98 views
How to create the report in the controller without the aspx?
I made the following code below but I am not getting html print screen

public ActionResult test() {          
           var instanceReportSource            = new Telerik.Reporting.InstanceReportSource();
           instanceReportSource.ReportDocument = new myReport();
             
           ReportViewer report = new ReportViewer();
           report.ID           = "Teste";
           report.Width        = 100;
           report.ReportSource = instanceReportSource;
 
return ??
}
Diego
Top achievements
Rank 1
 answered on 01 Jul 2013
1 answer
271 views
Hi. 

I bind against a ObjectDataSource that expose boolean properties that shall decide which of three versions of a particular table I display.

The detail section of the report is pretty large and this "polymorphic" table is a small part of it.

I bind the table Datasource against the "ReportItem.DataObject" property and its Visible attribute against the associated boolean.

However, these tables differ in size, and I would like to avoid the whitespace.

I could stack them on top of eachother (z order) in a panel that has "CanShrink" set to true, but this makes it hard to edit the report in the designer.

Is there any solution where:
  • I work with them in the designer, 
  • only the ones that evaluates to Visible=true will be displayed
  • no white space left after the ones that evaluates to Visible=false.
Peter
Telerik team
 answered on 01 Jul 2013
3 answers
401 views
For each row in a detail section, I need the field value from the same field in the previous row to calculate the difference. Is this possible and if yes, how?

:o)
Jon Ivar
Gaurav
Top achievements
Rank 1
 answered on 01 Jul 2013
1 answer
783 views
I'm wondering if anyone can give me any pointers on how to add a custom font to my reports. The reports will be rendered as PDF. I have the font installed locally but want to be able to use it in my reports. Thanks!
Peter
Telerik team
 answered on 28 Jun 2013
1 answer
322 views
I'm really having a tough time getting the speed of my PDF exports down to something reasonable. The reports I'm generating are not really summary or aggregation reports, they're "everything" reports with a great deal of text. Report page counts can be tens, hundreds, or even thousands-- alas, the requirements are fixed. The export is so slow that I've had to run the ReportProcessor in a Windows Service to do it all asynchronously. Within the report designer's preview tab in Visual Studio the generation seems to take seconds instead of minutes or hours.

To anyone reading this, I'd appreciate some tips on formatting my reports to improve speed of export to PDF.
Squall
Top achievements
Rank 1
 answered on 28 Jun 2013
1 answer
115 views
this.Fields["DeliveryTermsID"].Value.Tostring()

does not work "Reports.TelSubRptContract does not contain a definition for 'Fields'

so what would work?  I am trying to pass values to a txtbox on the subreport from the datasource that it has been given.
Squall
Top achievements
Rank 1
 answered on 28 Jun 2013
2 answers
236 views
This is a weird one.  I have an ASP.Net page with the report viewer control.  The report is in a separate dll as per best practice recommendations.  When the page comes up, the report area is blank.  But, if I export the report to PDF, the report contents are there as expected.  What is going on with this? 

Clicking the Preview or refresh buttons does not help.

This is the code in the viewer page (the session variable does have a value and it comes in correctly:
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
    'If Not IsPostBack Then
    Dim report1 As New PMP2Reports.DocumentsReviewed
    Dim objSession As Object
 
    objSession = Session("subIdx")
    If Not objSession Is Nothing Then
        report1.ReportParameters("subIdx").Value = objSession
    End If
 
 
    ReportViewer1.Report = report1
    ReportViewer1.RefreshReport()
    ' End If
 
End Sub


VS 2010, Reporting 2012 Q1

Thanks.
Jon_BCV
Top achievements
Rank 1
 answered on 27 Jun 2013
3 answers
117 views

Hi. This is probably an easy question for somebody to answer but it is driving a noobie like me nuts tonight. I have a report that has 3 parameters (date_start, date_end, worker). I set up the parameters as usual and assigned some default values to them.   I have some tables that use a sqldatasource to  display some data based on those parameters. This works fine. I have absolutley no isues with the tables displayign data using the parameters

What I am trying to do is use some code behind (presumably in itemdatabound event) to do a calculation and display some text in a textbox based on the number of days between start and end date parameters. I can get this calculated data to display. but it always displays values based on the default value of the parameters and not what is selected in the dropdowns for the parameters. if i clear the default values from the parameters, the report errors out because it thinks the default values for the dates are blank or null.
 
Does the itemdatabound event fire before the parameters are available to use and calculate against?

What should I be doing?
Peter
Telerik team
 answered on 27 Jun 2013
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?