Telerik Forums
Reporting Forum
6 answers
796 views
Hi,

I've develpoed a dozen Telerik reports for my application.

I connect to any handy datasource to design and preview reports but in production I always supply a dataset myself like this...

Public Sub New(ByVal sConn As String, ByVal sSQL As String, ByVal ReportTitle As String)
       InitializeComponent()
        Dim ds As DataSet = SnagRData1.getDataSet(sSQL, sConn, "qSchedXtab")
        Dim dt As DataTable
        dt = ds.Tables("qSchedXtab")

        Me.DataSource = dt
    End Sub

This works fine for everything except my new xtab report where I get the exception - the data is present and correct but the report crashes the development PC as it trys in vain to use the data passed to it.

If I delete the SQLdatasource1 used to preview it still cannot match the data correctly.

Please help
Steve
Telerik team
 answered on 25 Nov 2010
3 answers
143 views
Hi Friends,
                   I have been using the below code to save my report.
                  
void SaveReport(Telerik.Reporting.Report report, string fileName) 
    { 
        ReportProcessor reportProcessor = new ReportProcessor(); 
        RenderingResult result = reportProcessor.RenderReport("PDF", report, null); 
 
        using (FileStream fs = new FileStream(fileName, FileMode.Create)) 
        { 
            fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length); 
        } 
    }     

But how to make a report from code behind for a large table.I have referred the following link
http://www.telerik.com/help/reporting/programmatic-control-of-reports.html. Its ok for tables with few columns.I have also seen the code from InitializeComponent() of the designer.cs file.I want everything to work from code behind(Creating report,Assigning SqlDatasource and so on.) Can any one help me.Can any one give a sample code for large table queries. Im not using ReportViewer to see the report.I just want to save my report as file.


          Telerik.Reporting.Report report = new Telerik.Reporting.Report();
            Telerik.Reporting.SqlDataSource dataSource = new Telerik.Reporting.SqlDataSource();
            dataSource.ProviderName = "System.Data.SqlClient";
            dataSource.ConnectionString = @"Data Source =(local)\SQLEXPRESS2008;
                                 Initial Catalog=TestDb;Integrated Security=True;Pooling=False";
            dataSource.SelectCommand = @"SELECT * FROM [TestTable]";
            report.DataSource = dataSource;

Wat to do after this if my 'TestTable from Db 'has more than 20 columns and more rows..Can i use Telerik.Reporting.Table for this??


Regards and Thanks
Titti.S





Massimiliano Bassili
Top achievements
Rank 1
 answered on 25 Nov 2010
1 answer
153 views
What does reset style do?....I mean I can GUESS :)  But it seems like it's not resetting all the properties.

I've got two textboxes, both I want to look the same.  So the one I just freshly dropped onto the report looks default (arial 10).  Then there's another one who's got Tahoma, grey color, aligned right.  If I copy the style if the new box I dropped and paste it into the Tahoma one, nothing changes.  I assume this is becasue "Default" isn't a style?  I would assume though that the properties set on the one textbox should propagate to the other one since the default settings are still technically a style.

Ok, so given that didn't work I tried in the opposite direction.  Copied the style from the tahoma and pasted it into the new one and everything worked great....however that's not what I wanted so I tried a Reset Style on both.

I got Arial 10pt on the one box, and Tahoma 11pt on the other.

What is it resetting it to?
Steve
Telerik team
 answered on 24 Nov 2010
1 answer
110 views
I  created   a  report   to display   a  bar  chart.
I  added  this   report  as  a  sub report  inside    the  group header of another  report.
The  problem  is  Chart  individually  executing well and giving  correct results. 
But  after  adding the this report  as a sub report to another report  the  chart is not being  displayed  well.  
Steve
Telerik team
 answered on 24 Nov 2010
2 answers
189 views
I have a drop down parameter that list 2000+ items. Is there a way to limit this and function like your combobox. For example have the user type and auto find using a like statement that brings back the top 50 items.


thanks
Dwayne Starkey
Top achievements
Rank 1
 answered on 24 Nov 2010
0 answers
76 views
Hi,

How can I pass a full ReportBook of reports to external page with ReportViewer control in it?

I've created my individual reports in code...

Dim reportBook As New Telerik.Reporting.ReportBook()
            reportBook.Reports.Add(New TelerikWebReports.SubCon1Rep())
            reportBook.Reports.Add(New TelerikWebReports.SubCon2Rep())
etc.

then I set

LaunchReportViewer = True

which fires off TelerikReportViewer.aspx in a colorbox
In the page_Load event I want to do something like...

ReportViewer1.Report = reportBook

do I need to pass this as a session object?

Thanks
graham
Top achievements
Rank 1
 asked on 24 Nov 2010
0 answers
60 views
I have several sub-reports within the detail section of my report. It currently returns each sub-report in order for each row in the report. I was hoping to consolidate the sub-reports rather than go through the entire detail for each row. Is this even possible? If so how do I go about it as I have already tired making separate detail sections for each sub-report and that didn't seem to work out.

Example:
   Current:
    Row1- subreport1
    Row1 - subreport2
    Row1-subreport3
    Row2- subreport1
    Row2 - subreport2
    Row2-subreport3
    Row3- subreport1
    Row3 - subreport2
    Row3-subreport3

Desired:
    Row1- subreport1
    Row2 - subreport1
    Row3-subreport1
    Row1- subreport2
    Row2 - subreport2
    Row3-subreport2
    Row1- subreport3
    Row2 - subreport3
    Row3-subreport3
Bradley
Top achievements
Rank 1
 asked on 24 Nov 2010
1 answer
52 views
Hello there,

I have 8 graphs in a telerik report and each of these graphs is assigned to the same datasource which calls a sproc.  But we did a trace and looks like the report calls this same sproc as many time as the # of graphs on the report.  So currently, I have 8 graphs that is assigned to the same datasource, the report calls this sproc/datasource 8 times (each for a graph).

So for each graph, I see the line this.chart1.DataSource = this.Graph (Graph is the name of the datasource), but of course the # changes from each graph from 1 to 8.  How do fix this?  How do we just call the sproc/datasource 1 time and then feed all the graphs from the data returned from this one call?

Thank you so much for your advice and your help!

-Bryan
Peter
Telerik team
 answered on 24 Nov 2010
5 answers
192 views
Hi
I am getting the following error when I produce a report which contains a sub report, and the sub report relies on filtering using a parameter: - The expression contains object 'parExpenseFormId' that is not defined in the current context. It doesnt seem to recognise that I have already added the parameter although I have.
This worked absolutely fine in an older version of Telerik Reporting but I have now had to upgrade to version 4.1.10.71 (Q2 2010) I am getting the error. I cannot use Q3 because it has another bug which prevents me from using it.
Can someone please help me - I am generating my SubReport in the following manner:

1. Main Report

SubReport

 

oSubRep = new SubReport();

 

 

Report oEntriesRep = ExpenseEntriesReportBuilder.GetReport(); // Create the sub report (see extract below)

 

oSubRep.Width =

new Unit(735, UnitType.Pixel);

 

oEntriesRep.DataSource = dsData.Tables[1];

oSubRep.ReportSource = oEntriesRep;

oSubRep.Parameters.Add(

"parExpenseFormId","Fields.[expense_form_id]");
oDetails.Items.Add(oSubRep); // Add the subreport to the details section of the report

2. This is how I generate the actual sub Report

 

 

 

ExpenseEntriesReportBuilder. GetReport()

 

{

 

Report oRep = new Report();

 

oRep.PageSettings = GetPageSettings();

oRep.Items.Add(GetHeaderSection());

oRep.Items.Add(GetDetailSection());

oRep.Items.Add(GetFooterSection());

oRep.Filters.Add(

new Filter("=Fields.[expense_form_id]", FilterOperator.Equal, "=Parameters.parExpenseFormId"));

 

 

return oRep;

 

}

Thanks in advance

Michael Gois
Top achievements
Rank 1
 answered on 24 Nov 2010
2 answers
82 views
I have a big text that flows through several pages. Most of the times, the last line in page X is repeated and horizontally cropped in the beginning of page X+1.

I'm using version v2.0.50727.

Thanks a lot!
Steve
Telerik team
 answered on 23 Nov 2010
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?