Telerik Forums
Reporting Forum
2 answers
309 views
Hi all,

I have a report localized in many languages and it works well when I request the contents from a report viewer and I set the threat to match the report's localized language.

Now, I would like to download the report without having to change the current threat or using the report viewer. The code below generates the PDF file directly and presents the document ready for download to the browser, this is what I would like to have but I cannot get it translated. I was trying to use the report parameters with the report's code behind to set the language in the report but unfortunately the report must be initialized before I can work with the parameters.
Is that possible?

The code looks like this:
Dim instanceReportSource As New Telerik.Reporting.InstanceReportSource()
instanceReportSource.ReportDocument = New Reporting_Service.doc_PO_ShippingInstructions
instanceReportSource.Parameters.Add(New Telerik.Reporting.Parameter("Id", 31))
instanceReportSource.Parameters.Add(New Telerik.Reporting.Parameter("LanguageID", 1))
 
Dim reportProcessor As New ReportProcessor()
Dim result As RenderingResult = reportProcessor.RenderReport("PDF", instanceReportSource, Nothing)
Dim fileName As String = result.DocumentName + ".pdf"
Response.Clear()
Response.ContentType = result.MimeType
Response.Cache.SetCacheability(HttpCacheability.Private)
Response.Expires = -1
Response.Buffer = True
Response.AddHeader("Content-Disposition", String.Format("{0};FileName=""{1}""", "attachment", fileName))
Response.BinaryWrite(result.DocumentBytes)
Response.End()
IvanY
Telerik team
 answered on 05 Mar 2013
0 answers
110 views
Hey, I got a problem with the following requirements:
By clicking a button a report has to be generated and immediately downloaded in special format. 
I would also prefer using trdx Files for designing reports. I found out that these files can be used by the report viewer, but using a report viewer doesn't meet the requirement. 

my problem in particular is that the second parameter of the method RenderReport is a ReportSource. But there is no way to use the trdx File. 
Maybe I use a wrong pattern, or do I have to serialize the trdx File and create a Report.cs File ?

Thank you in advance


EDIT:

Sorry, I found out, that it is possible to use the trdx file as ReportSource by using UriReportSource

So, problem solved
BigzampanoXXl
Top achievements
Rank 1
 asked on 05 Mar 2013
6 answers
241 views
Hello,
I've revisited my report upgrading it to last stable build (so I've to use InstanceReport for passing data to the subreports) but I've got a really ugly problem.... I've got data mixed.... for example report for user 1 contins data for user2 and so on...I'm afraid that the static InstanceReport is the problem... that the report on thread x reads data from thread y and so on...

any feedback on this?
Thanks
Svetoslav
Telerik team
 answered on 05 Mar 2013
2 answers
232 views
I want to show the Hashtable data in textbox of Telerik report. My class structure is like:

Public class MyClass
{
public Hashtable ValHash { get; set; }
}

MyClass obj = new MyClass();
obj.ValHash = new Hashtable();
obj.ValHash.Add("Name", "Prasant");

While setting Hahtable value to textbox, as:
this.textBox1.Value = "= Fields.ValHash[\"Name\"]";

I am getting an error as "Missing operator before '["Name"]' operand.

Am i doing anything wrong?
Prasant
Top achievements
Rank 1
 answered on 05 Mar 2013
2 answers
152 views
I get a strange error when i try to output an excel report book to a response stream. This code was working perfectly before cant figure out why telerik is behaving strangely. We are using Telerik reporting 4.0.10.310.  
What is wrong... my intention is the excel file must download to the client on click of a button.
Here when i click on the save and open the file from the local drive the xls is perfect.
but when i click on open .... it downloads a copy of the aspx page where it says the format is different or the file is corrupted.
This is my code
I found if i remove the multiview and the view the same exact code works perfectly. I have another form where this kind of set up works(multiview-view-updatepanel). I dont understand the difference.
What is wrong?


Page has a buttion inside Multiview->view->updatepanel

<asp:MultiView ID="mvwReports" runat="server">

<asp:View ID="vwTotalCostOfOwnership" runat="server">

                                <div id="divExport" runat="server" class="aright">

                                     <asp:UpdatePanel runat="server" ID="UpdatePanel1" UpdateMode="Conditional" RenderMode="Inline">

                                        <ContentTemplate>

                                            <asp:ImageButton ID="imgBtnExcel" runat="server" CausesValidation="false" ToolTip="Excel"

                                                Visible="true" AlternateText="Excel" Enabled="true" ImageUrl="~/App_Themes/WebBlue/images/excel_icon.gif"

                                                OnClick="imgBtnExcel_OnClick" />

                                        </ContentTemplate>

                                        <Triggers>

                                            <asp:PostBackTrigger ControlID="imgBtnExcel" />

                                        </Triggers>

                                    </asp:UpdatePanel></div>

                                    </asp:View>

                                    </asp:MultiView>

Code behind

protected void Page_Load(object sender, EventArgs e)

        {

            mvwReports.ActiveViewIndex = 0;

            

        }

        protected void imgBtnExcel_OnClick(object sender, EventArgs e)

        {

            Response.Clear();

            Response.ContentType = "application/vnd.ms-excel";

            Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache);//(HttpCacheability.Private);

            Response.Expires = -1;

            Response.Buffer = true;

            Response.AddHeader("Content-Disposition", string.Format("{0};FileName=\"{1}\"",

                                "attachment","test" + ".xls"));

            Response.TransmitFile("e:\\temp\\excel\\test.xls");

            HttpContext.Current.ApplicationInstance.CompleteRequest();

        }

David
Top achievements
Rank 1
 answered on 04 Mar 2013
12 answers
884 views
This is an ASP.Net app with a page with a report viewer control on it.  The very first time in a session that you export any report to PDF, it is very sloooow.  It can take a minute, and this is on a very good production server.  Then, the next report you export is virtually instant.  Or go to another report, the export is still instant.

Anyone else notice this? 

Seems like this would be an issue of loading an assembly or something, then once it's there, things are fast.  This problem also exists in SSRS.  It is not a good user experience though and I don't think it should be like this. 

Is there anything to be done about this?  I was thinking a poor man's solution would be to script something that does an export periodically behind the scenes, just to keep the code loaded up in memory or something.

Thanks.
Stef
Telerik team
 answered on 04 Mar 2013
2 answers
59 views
Hi team,
i couldn't find the video for the below demo.
http://demos.telerik.com/reporting/report-book/video.aspx
Regards,
Mohammed
Mohammed
Top achievements
Rank 2
 answered on 04 Mar 2013
3 answers
118 views
Dear team,
I'm afraid to say I got crazy with the chart styles or its configuration in general.
I try to study the documentation and make implementation to a sample static chart I created.
I assigned a skin to the chart at the beginning and after that i tried to customize the styles according to what i read in the documentation but almost every time i don't see the updated styles.
now I see in the design mode some of my styles but when I run it in the preview mode I can't see it "check the attached photo"
is chart styles override each other ? and if yes how can i know what override what ?
we are attending to buy the reporting tool but as you see I have troubles to understand the chart.
Regards,
Mohammed
Mohammed
Top achievements
Rank 2
 answered on 04 Mar 2013
2 answers
536 views
Hi team,
in my application I use a library project to present my business logic layer.
normally when I create a report in visual studio i can see my layer while creating the object data source.
how can I do the same in the stand alone designer.
I want to use the object data source while creating a report in the stand alone designer.
and what if the business logic project updated, what should i do to make the designer feel the updates.
Regards,
Mohammed
Mohammed
Top achievements
Rank 2
 answered on 04 Mar 2013
3 answers
174 views
Hi,

I put static content in htmlTextBox of one page. It is showing in normal preview and html view. But If export that report in rtf format and open in word, it is showing only 1/4 content. Page breaks also not showing as showin in preiview. I have set CanGrow=true and CanSink=true, PageBreak=Before for all the sections, but the problem still there.

Please help me regarding this.


Regards,

B.Sridhar
Chavdar
Telerik team
 answered on 04 Mar 2013
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?