Telerik Forums
Reporting Forum
4 answers
608 views

Hello, I am new to Telerik. I want to have a button in my ASP.NET MVC web application that when clicked:

  1. executes a .trdx standalone Telerik file
  2. exports the output to a Word file

I don't know how to get started with this, what tutorial might help explain this? What sort of methods might be available? Here is my pseudo-code of what I would like to do:

string filePath = Server.MapPath("~/reportFolder/reportFile.trdx");
// I made this stuff up:
Telerik.StandaloneReport myReport = new Telerik.StandaloneReport(filePath);
myReport.executeAndPromptTheUserToSaveAs();

I have the .trdx file linked to my database, and so it is already correctly processing the report I want. Keep in mind that I don't want to embed the report in the web application in any way, I just want to "Save as..." the output of the .trdx report file when clicking a button in the application.

Ian
Top achievements
Rank 1
 answered on 08 Aug 2014
3 answers
166 views
Hello Telerik Reporting Team,

I would like to ask you to help me formatting PDF export.

Simply what I want to achieve is to let a report start to be printed only in odd numbered page.

For example,
let's say our system is trying to generate employee report in a department.
This department has 5 employees, so the report template needs to be iterated 5 times.

And each report has different length of page, let's say 1, 2, 3, 4, 5 pages for each employee.

When I export this reports, I would like to see 

PDF page1. Report for Employee1
PDF page2. Empty page
PDF page3. Report for Employee2
PDF page4. Report for Employee2
PDF page5. Report for Employee3

PDF page6. Report for Employee3
PDF page7. Report for Employee3
PDF page8. Empty page
PDF page9. Report for Employee4
PDF page10. Report for Employee4
PDF page11. Report for Employee4
PDF page12. Report for Employee4
PDF page13-17. Report for Employee5

Please advise me if any approach to handle this issue.

Thank you
Sean

Stef
Telerik team
 answered on 08 Aug 2014
2 answers
347 views
Hello guys,

I would like to create a quite simple report with a map and in these map to show several points at coordinates supplied from database. Unfortunately, I am not able to realize this task following the documentation. It just render the map extent, but without markers. I am sure that I am doing something wrong, but I found the documentation a bit confusing, for example the map extent seems to be in WGS84 coordinates, but the Projection property seems to to only the Mercator and from this comes a question in what kind of coordinates should be supplied to Latitude/Longitude properties of Series (property of Map). 

Thanks for any example or other help.

Best regards,

    Robert
Robert
Top achievements
Rank 1
 answered on 08 Aug 2014
1 answer
115 views
The code below is used to export reports programatically based on the sample in the link http://www.telerik.com/help/reporting/exporting-report-programmatically-in-silverlight.html

void serviceClient_RenderCompleted(object sender, RenderEventArgs e)
{
var result = e.RenderingResult;
if (this.file != null)
{
this.file.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);
this.file.Close();
this.file.Dispose();
this.file = null;
}
}

It stopped working after a data center move, it was working before in production too. After the datacenter move the report is rendered to the UI and the report is also exported but with no data.Could you please tell me what could be the reasons.

Thanks



Stef
Telerik team
 answered on 08 Aug 2014
3 answers
190 views
Is there a way to write a custom rendering extension for Telerik Reporting?
Stef
Telerik team
 answered on 08 Aug 2014
1 answer
171 views
hi
i have a column which indicate as my date time data.
and i have two report parameter which work as start date and
End date.i want set my start date as minimum date in which stored in datetime column
and if no data stored be today date time
Thanks for wonderful suppor
Hinata
Top achievements
Rank 1
 answered on 07 Aug 2014
1 answer
360 views
Hi 

I would like to know if it is possible for me to hide the print button when a person views a report.
As i have been having issues with the browser/print functionality i would like to hide the print button and just allow them to export to CSV and PDF is this possible?
Stef
Telerik team
 answered on 07 Aug 2014
1 answer
113 views
I'm trying to modify the control template for the ReportViewer using Blend. When I choose Edit Template > Edit a Copy, it creates a blank ControlTemplate instead of a copy of the ReportViewer's default template:

<UserControl.Resources>
  <ControlTemplate x:Key="ReportViewerControlTemplate1" TargetType="rv:ReportViewer"/>
</UserControl.Resources>
 
<Grid x:Name="LayoutRoot" Background="White">
  <rv:ReportViewer Template="{StaticResource ReportViewerControlTemplate1}" />
</Grid>

I'm using Telerik RadControls for SIlverlight Q3 2013, Telerik Reporting Q3 2013, Expression Blend 4. Does the ReportViewer have some other dependency that's preventing this from working?
Stef
Telerik team
 answered on 07 Aug 2014
3 answers
459 views
Hi,

I've a WPF application that use Reporting to display data. The application use web services to connect to the server and underlying database. Report are designed using visual studio and ObjectDataSources. Now I need to give users the ability to design report using the telerik standalone designer.

Using the procedure described here I can expose my business data to users; the question is: how can I display the preview data? The designer will run on the client machine that have no access to database (the data access is done by Web Service on the server).

Furthermore, is there a way to intercept save command on the designer to save report directly on the database instead of on the local file system?

Thanks in advance for any kind of help
Stef
Telerik team
 answered on 06 Aug 2014
1 answer
314 views
So I'm new to Telerik, and have been struggling getting a NeedDataSource event to fire in an ASP .NET web application with the latest version of Reporting, Q2 2014 (8.1.14.618).  Interestingly, the code I'm about to post works fine in the much older version (3.1.9.701) and I'm at a loss as to what has changed and why the code that used to work is broken now.  

So in our aspx page we have a simple ReportViewer Control

<body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" style="margin: 0px;">
    <form id="form1" runat="server">
        <div style="height: 100%;">
            <telerik:ReportViewer ID="ReportViewer1" runat="server" width="100%" height="100%">
            </telerik:ReportViewer>
        </div>
    </form>
</body>


The code behind file goes and gets data when the page loads:
01.protected void Page_Load(object sender, EventArgs e)
02.{
03.    if (!IsPostBack)
04.    {
05.        LoadData();
06.    }
07.}
08. 
09.private void LoadData()
10.{
11.    Page.Title = "Report Title";
12. 
13.    ReportBook reportBook = new ReportBook();
14. 
15.    CustomReport1 report = new CustomReport1();
16.    CustomReport2 report2 = new CustomReport2();
17.    CustomReportData data = new CustomReportData(_Id);
18.    report.DataSource = data;
19.    report2.DataSource = data;
20. 
21.    reportBook.Reports.Add(report);
22.    reportBook.Reports.Add(report2);
23. 
24.    this.ReportViewer1.Report = reportBook;
25.}


And then the code generated from the designer looks like this, CustomReport1.cs:
01.public partial class CustomReport : Telerik.Reporting.Report
02.{
03.    public CustomReport()
04.    {
05.        /// <summary>
06.        /// Required for telerik Reporting designer support
07.        /// </summary>
08.        InitializeComponent();
09. 
10.        //create event that will set the data source for the table
11.        tbl.NeedDataSource += new EventHandler(tbl_NeedDataSource);
12.    }
13. 
14.    /// <summary>
15.    /// Handles the NeedDataSource event of the tbl control.
16.    /// </summary>
17.    /// <param name="sender">The source of the event.</param>
18.    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
19.    void tbl_NeedDataSource(object sender, EventArgs e)
20.    {
21.        //In order to programmatically set the table, we need to use the processing table
22.        Telerik.Reporting.Processing.Table table = ((Telerik.Reporting.Processing.Table)sender);
23. 
24.        //set the data source of the table
25.        table.DataSource = ((CustomReportData)table.Report.DataSource).CustomCollection;
26.    }
27.} 

For line 25, CustomCollection is just a list of BLL objects.  The craziest thing for me is that when I run with the old version I can hit breakpoints inside tbl_NeedDataSource function.  However, with the new Telerik controls I am unable to hit anything in the tbl_NeedDataSource function.  I'm wondering what may have gotten lost in translation to the newer controls, maybe there's some kind of mechanism that became obsolete between those two versions that would cause the "wiring" not to work.  Or maybe there's just a better way to do this now :)  Any thoughts or suggestions would be helpful.  Thanks in advance!
Stef
Telerik team
 answered on 06 Aug 2014
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?