Telerik Forums
Reporting Forum
2 answers
93 views
I have a windows form with the ReportViewer control on it which I re-use to show various reports. I also have properties on that form to set the report parameters. The first time I show a report with the form it works fine. But for some reason after that I get conversion errors with what seems to be the passing of the report parameters. It's as if it's not closing down the form fully or something.

The start of my form code is like this (I pass in the report I want to view):

    public partial class ReportTester : Form
    {
        public ReportTester(Telerik.Reporting.Report Report)
        {
            InitializeComponent();

            reportViewer1.Report = Report;
            reportViewer1.RefreshReport();
        }

        public int UserId
        {
            set { reportViewer1.Report.ReportParameters["UserID"].Value = value; }
        }
...

And then in my main form I launch reports like this:

                    ReportTester report;
                    if (type == ReportTypeEnum.Regular)
                    {
                        report = new ReportTester(new BPReports.Report1());
                    }
                    else
                    {
                        report = new ReportTester(new BPReports.Report2());
                    }

                   report.UserId = _currUser;
                   report.ShowDialog();
....

But the second time I show a report even if it's the same report I get an error in the viewer about not being able to convert int to string or string to datetime.

Any ideas?

Steve
Telerik team
 answered on 09 Oct 2008
1 answer
202 views
Hi,

I have report with 10 columns inside, all textboxes inside report have CanShrink=True, and user before generation report choose, what columns he want to display(I'm just setting Visible property to True/False based on user choise). The problem is that if user want to display only one or two column report is left aligned with standart width of columns. I need something like GridView has -
gridView1.MasterGridViewTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;  
gridView1.MasterGridViewTemplate.BestFitColumns(); 
Steve
Telerik team
 answered on 08 Oct 2008
6 answers
288 views

1. We need to show the filtered time in report header.
 A textbox added to the position, and assigned to the time string, but empty showed after generation.
2. We need to show empty table when the report query no record, but when i set the datasource to empty IEnumerable<BusinessObject> or null, such error appear as following:

#ERROR# The expression contains object 'CategoryName' that is not defined in the current context.

Appreciated for any response.
Steve
Telerik team
 answered on 07 Oct 2008
2 answers
246 views
Hello,

I'm trying to build a simple ASP.NET web application with two pages. One containing controls that determine the filter parameters for a report that I would like to display on another web page.
As the documentation lack good examples, I've searched in your support web site and found a video that explains how to create a similar project using Telerik Reporting 2007. While trying to do the same with Telerik 2008 SP1, I can't seem to find the SqlDataAdapter in the Telerik Reporting ToolBox (VS 2005).
Can you please guide me in the right direction?

Regards,
Tzach. 
Vishal
Top achievements
Rank 1
 answered on 06 Oct 2008
2 answers
103 views
We use Telerik.Reporting.Processing.ReportProcessor.Render to output barcode programmatically, everything goes fine, but the Render step speed cost 1 sec. I'v tried the barcode font method, the graphics renders much faster, i dont' know why the reporter render cost so much time in render a simple barcode, 1 sec really not good for us when we generate 100 codes at a time in web interface.
Appreciated for any response.
Sonic
Top achievements
Rank 1
 answered on 06 Oct 2008
6 answers
1.2K+ views
I have a text box on the report called txtTotal and I am using function =Sum(Fields.Amount) to get the total of all the txtTotalAmount values. I have placed this field in the  ReportFooterSection1 so I can get all totals on the last page only.

When I get the data back from the server, it will have multiple Total values that will be visible on txtTotal . Then I want to get the grand total amount in text box, txtTotalAmount. On the design time, I am getting the total, but when I view the report on the Web, the report shows the list of all the total values, not the Sum.
How do I resolve this issue?

Thanks
Khan
Top achievements
Rank 1
 answered on 03 Oct 2008
4 answers
328 views
So far I've been formatting reports by simply modifying the Style property of the various elements. However, I now have a situation where I would like for users to be able to override the default style. Actually, users are very unlikely to modify the styles themselves, but we need to be able to customize the styles for them.

This "report" is currently done with HTML and we use CSS to make customizations. I'm hoping we can achieve something similar with Telerik reports.

First off, is there a way to feed XML representing an "external stylesheet" directly to the report? Or do we need to write the XML to a file then set a path to that file? The XML will be stored in a database and it would be nice if we could feed the XML directly to the report without having to create a temporary file. I see that there is an overload on the ExternalStyleSheet constructor that takes a Stream. I'll see if I can get that to work.

Second, I don't see a Style Selector that is analogous to the "#ControlId" CSS selector. Is it possible to create styles in the external style sheet that target a specific control by name? If not, I guess I can work around this by setting the StyleName to always match the control name?

Third, when I try to override a style that is defined in the report with a different value in the external style sheet, it doesn't appear to work. For example, the report defines a "InfoPanel" style with a solid border. If I try to remove the border in the external style sheet the border is still there. Here is the external style sheet XML:

<?xml version="1.0" encoding="utf-8"?> 
<StyleSheet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  <StyleRule> 
    <Style> 
      <BorderStyle> 
        <Default>None</Default> 
      </BorderStyle> 
    </Style> 
    <Selectors> 
      <StyleSelector> 
        <Type>ReportItemBase</Type> 
        <StyleName>InfoPanel</StyleName> 
      </StyleSelector> 
    </Selectors> 
  </StyleRule> 
</StyleSheet> 

Interestingly, setting the border style to "Dashed" instead of "None" does work (the border becomes dashed). But I seem to be unable to remove the border using "None".

I think that's it for now.

Scott
Scott R
Top achievements
Rank 1
 answered on 03 Oct 2008
1 answer
101 views
*****Page PDFReport.aspx******

<%

@ Register assembly="Telerik.ReportViewer.WebForms, Version=2.8.8.925, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" namespace="Telerik.ReportViewer.WebForms" tagprefix="telerik" %>

<

telerik:ReportViewer ID="PDFReportViewer1" runat="server" ></telerik:ReportViewer>

*****Code behind PDFReport.aspx.vb******
*****Class C_PDFReport*****

Me.PDFReportViewer1 = Nothing

*****Compile error*****

Error 1 'PDFReportViewer1'
 is not a member of 'LHLP.C_PDFReport'.
 D:\IISPUB_LHLP\LHLP\C\PDFReport.aspx.vb

*******************************************************

Intellisense Me. finds PDFReportViewer1

Due to compile error, unable to open the web reportviewer

Any clues as to the cause or workaround?

Thanks


Chavdar
Telerik team
 answered on 03 Oct 2008
2 answers
136 views
Have three panels in report designer.
In the report designer, report designer preview, and report designer PDF export, the right margin of the three stacked panels are aligned vertically,
set to the page width of 7.50 inches in properties.

In an ASP.NET web page, launching the Telerik: ReportViewer, the margin of the first panel is now about 1 physical inch wider than the following two panels, but in the PDF export, all three panels are realigned just as they were in report designer preview PDF export test.
All other report objects, header, panels 2 and 3, footer, and page numbering
are all aligned properly to the page width.

The first panel contains four side by side graphics
with four text boxes underneath.
Text boxes are set to auto wrap.

Any ideas as to how to control the reportviewer panel width in ASP.NET page?

Thanks 
Chavdar
Telerik team
 answered on 03 Oct 2008
5 answers
286 views
Hi, I am try to draw a table-like format report using Dock. But can not get it work.

What I want for my report is like the following:

----------------------------------
| col1     | col2      |  col3  |   col4  |
----------------------------------
|             |             |          |            |
|             |             |          |            |
|             |             |          |            |
|             |             |          |            |
|             |             |          |            |
|             |             |          |            |
-----------------------------------

basically, no horizontal lines for data items, only vertical lines to seperate every column.

I tried to set dock to left for every col header (which is in my group header section), but the col1 kept moving to the most right position. other col also moved, the column sequency is change as I set dock property to left for each of them.           

Another problem is there is always a blank between the vertical lines  in the detail section.

Am I doing this right. or we have another better to achieve what I am trying to do.

Thanks in advance


 
Rossen Hristov
Telerik team
 answered on 03 Oct 2008
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?