Telerik Forums
Reporting Forum
3 answers
414 views
Hello,

I have an issue with the name of the generated files when exporting a report to PDF or XLS from the report viewer. When a report contains a "special character" (for example "ä") in its name the character in question is not rendered correctly when clicking on the "Export" link. Instead I have a question mark wrapped in a black losange.

I understand this issue is related to URL encoding but I'm not sure how to handle it. Here's my scenario with more details:

Environment information:
- Silverlight 4.0
- IIS 7.0
- IE 8.0
- Telerik Reporting 2012Q1

In our Silverlight 4 application, a user wants to create a report. At first, he is on a page (a FloatableWindow) on the application and clicks on a button. This button sends the user to the ASPX page handling the report generation. The click on the button actually calls HtmlPage.Window.Navigate with the URI of the ASPX page in question and a bunch of parameters we use to generate the appropriate report. Among these parameters, one corresponds to the name the report will be given (also used as the file name which the report will be generated to). When debugging, in the ASPX page, I can see that the name of the report is correctly encoded (ie. the character "ä" is present and displayed correctly in the report name). The report is generated correctly in the report viewer but when clicking on the "Export" link (to PDF or XLS, same behavior), the name of the file does not hold this character anymore but instead the question mark with the black losange. Below are some code extracts that may help on our process.

Code-behind of the ASPX page holding the ReportViewer:

public class ReportManagementPage : Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Report report = new MyReport();
        report.Name = Request.QueryString["reportName"];
        report.DocumentName = Request.QueryString["reportName"];
  
        reportViewer.Report = report;
    }    
}

The above code correctly assigns the report name and document name correctly encoded. Clicking on Export does not use the correct encoding. If I right-click on "Export" and select "Open in new tab", the URL in the URL box of IE looks fine but the title of the page (in the tab and in the browser) uses the wrong encoding. FYI, spaces are correctly rendered and do not use %20, not even in the URL. Is there any way to fix this and tell the "Export" link/button what encoding to use for the file name?

Thanks for your help.
Stef
Telerik team
 answered on 03 May 2016
1 answer
265 views

Hi

 

How do I insert a 600 x 241 rectangle into a report header programmatically?

I've tried:

var myReport = new Report();
var header = new ReportHeaderSection();
header.Items.Add(new Shape
{
    ShapeType = new PolygonShape(4, 45, 0) { Bounds = RectangleF.FromLTRB(0, 225, 600, 466) },
    Size = new SizeU(Unit.Pixel(600), Unit.Pixel(241)),
    Location = new PointU(Unit.Pixel(0), Unit.Pixel(225)),
    Style = { Color = Color.DarkGray, LineWidth = Unit.Pixel(1) }
});
myReport.Items.Add(header);

But all I get is a square. Why isn't it expanding to a rectangle?

I've also tried using an ellipse (and got a circle funnily enough). The output doesn't change if I leave out the Bounds either.

Jeremy
Top achievements
Rank 1
 answered on 28 Apr 2016
1 answer
413 views

Hi,

I've been trying to set a specific parameters visible property based on another parameters value.

I have a boolean parameter that allows the displaying of more data in the report.

I have a 2nd boolean parameter that is hidden. If set to false the 1st bool parameters visible property to should then be set to false.

At the point of construction of the report, I check both 

 this.Report.ReportParameters["IsParamVisible"];

 this.ReportParameters["IsParamVisible"];

but the values are never set at that point so they do nothing.

How do I do this?

I'm using Telerik Reporting Q2 2015

 

Cheers

Katia
Telerik team
 answered on 27 Apr 2016
1 answer
398 views

Hello,

I have created a simple report using the standalone report designer and saved it as a .trdx file.
Here is my code to generate a pdf file:

Reporting.Report report = new Reporting.Report();
Reporting.XmlReportSource xmlReportSource = new Reporting.XmlReportSource();

// simple text box (Test2) in a report header

xmlReportSource.Xml = @"<?xml version='1.0' encoding='utf-8'?>
<Report Width='6.5in' Name='Report2' xmlns='http://schemas.telerik.com/reporting/2012/3.7'>
  <Items>
    <PageHeaderSection Height='0.200039307276408in' Name='pageHeaderSection1' />
    <DetailSection Height='0.299960772196452in' Name='detailSection1' />
    <PageFooterSection Height='1in' Name='pageFooterSection1' />
    <ReportHeaderSection Height='1in' Name='reportHeaderSection1'>
      <Items>
        <TextBox Width='1.20000016689301in' Height='0.19999997317791in' Left='2.64583333333333in' Top='0.395833333333333in' Value='Test2' Name='textBox1' />
      </Items>
    </ReportHeaderSection>
  </Items>
  <StyleSheet>
    <StyleRule>
      <Style>
        <Padding Left='2pt' Right='2pt' />
      </Style>
      <Selectors>
        <TypeSelector Type='TextItemBase' />
        <TypeSelector Type='HtmlTextBox' />
      </Selectors>
    </StyleRule>
  </StyleSheet>
  <PageSettings>
    <PageSettings PaperKind='Letter' Landscape='False' ColumnCount='1' ColumnSpacing='0in'>
      <Margins>
        <MarginsU Left='1in' Right='1in' Top='1in' Bottom='1in' />
      </Margins>
    </PageSettings>
  </PageSettings>
</Report>";
report.DataSource = xmlReportSource;
Processing.ReportProcessor reportProcessor = new Processing.ReportProcessor();
Reporting.InstanceReportSource instanceReportSource = new Reporting.InstanceReportSource();
instanceReportSource.ReportDocument = report;
File.WriteAllBytes(fileName, reportProcessor.RenderReport("PDF", instanceReportSource, null).DocumentBytes);

File created successfully, but it's empty, althogh report designer previews report properly.
What am I doing wrong?
I use Telerik.Reporting, Version=8.2.14.1222
Thanks in advance
Michael

Katia
Telerik team
 answered on 27 Apr 2016
1 answer
405 views

Hi,

I'm using Telerik 2013 Q2 (for .NET Windows).

I'm trying to generate a Dynamic Report, where the Columns are getting generated at run time.

When I use the code mentioned in the below link for grouping, the report shows only the first row of each group!!!

http://docs.telerik.com/reporting/data-items-how-to-add-groups-to-table-item-and-crosstab-item


Telerik.Reporting.TableGroup group1 = new Telerik.Reporting.TableGroup();

group1.Name = "Col1";
group1.Groupings.Add(new Telerik.Reporting.Grouping("=Fields.Col1"));


Why it is not showing all the rows of each group???

Kindly let me know.

with regards,
Krish TS

Stef
Telerik team
 answered on 27 Apr 2016
7 answers
665 views

Hi,

I recently started working with Telerik Reports and looks good.

Currently I'm working on Windows .NET application and need to create a fully dynamic simple report.

The report query varies based on the user selection on the windows application (report name, database table name, db columns, db condition, db grouping columns).

Based on the above selection, the query gets built dynamically (kind of a query builder tool).

This query result should be dynamically populated in the Telerik Report.

How can I acheive the Telerik report to handle these kind of dynamic queries?

I came across multiple forums asking for similar kind of question but I'm getting lost with multiple replies.

Kindly help on what is the clear way for doing this (with db column grouping too)? with any sample attachment please.

with regards,

Krish TS

Stef
Telerik team
 answered on 27 Apr 2016
3 answers
152 views

Hi

As the title says, your ssl certificate seems to have expired yesterday and the report viewer isn't working anymore therefore.
Example: GET https://kendo.cdn.telerik.com/2013.2.918/js/kendo.all.min.js net::ERR_INSECURE_RESPONSE

Our customers already noticed, please refresh.

Regards

Stef
Telerik team
 answered on 27 Apr 2016
3 answers
1.4K+ views
In my report I have used textboxes with "Fields" property to dynamically bind the data using CSV data sources. But in these text boxes I need to use line breaks/new lines using only one Fielld. For example I should be able to make csv field as "Janitha \n Silva" and in text box automatically new line should be added. I know that this can be done by using htmltextboxes. But I need to know is there any way to do this by using only textboxes, not htmltextboxes. 
Katia
Telerik team
 answered on 27 Apr 2016
1 answer
233 views

Hello. I have created a report using the Standalone Designer. I am able to display the report in an MVC view using an HTML5 Report Viewer but I have not been able to display data using ObjectDataSource and an in-memory business object.

I found this post by Stef on the forums (16 Jul 2014):
“The HTML5 Report Viewer and the Reporting REST service does not use the MVC concept. Thus if you have a model containing data or other information required in your reports, you need to implement a logic to access that model in the reports' controller e.g. to store the data and access it by key in the service's resolver, or to modify the reports to use such data source component, that wraps a data retrieval method having access to that model.”

¿Could you please elaborate how this is done?

The post continues: “… A demo of a report that uses a custom data retrieval method is available in the local examples under C:\Program Files (x86)\Telerik\Reporting Q2 2014\Examples\CSharp\ReportLibrary\DataBinding. The ListBoundReport uses an ObjectDataSource to retrieve data from a custom business object. This business object can be modified anywhere in the application, when the report is requested its ObjectDataSource will search for the assigned data retrieval method and will get the data.”

I have reviewed the example but I still don’t get how it works. The objectDataSource1 has DataSource assigned but no DataMember assigned. Shouldn’t the DataMember property contain the data retrieval method name mentioned in Stef’s post to get the data? In any case, how does it know what instance of the class should be used to retrieve the data from? Let’s say I have a Product class and there are 2 instances of this class: productA and productB, How do I tell ObjectDataSource to use product for instance?

Thank you very much in advanced,
Humberto

Stef
Telerik team
 answered on 25 Apr 2016
10 answers
635 views
Can someone help me with code to put inside my Win Form vb.net that will allow me to pass a Parameter to my Q1 2010 report that will affect the SQL WHERE Clause?  I am creating a Purchase Order Report and need to pass the report the PO Number that the report needs to generate. 

This has to be the simpliest of all report questions and I fill dumb for asking but I can't find any help on telerik website.  I have spent hours looking. 

Thanks!
Stef
Telerik team
 answered on 25 Apr 2016
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
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?