Telerik Forums
Reporting Forum
1 answer
447 views
When I pass a parameter through, for use in the Select statement of a SQL Datasource, it gets passed as Null, even though it appears correctly when I set the parameter to visible (for testing).

The parameter is a Guid which I convert to a string before passing and then convert back to a Guid in the Select statement.

If I remove the Where clause in the Select statement, its fine.

I am using version 7.2.1.4.127 and have run the upgrade wizard. I have tried putting single quotes around the Guid.

I pass the parameter as follows:

Model
        public TypeReportSource ReportSource
        {
            get
            {
                TypeReportSource reportSource = new TypeReportSource { TypeName = "AcumenSynergy.Reporting.PurchaseOrderLinesOutstanding, AcumenSynergy.Reporting"};
                reportSource.Parameters.Add("ProjectID", this.SelectedProjectID.ToString());
                return reportSource;
            }


View
<div id="projectIDSelector">
    @Html.LabelFor(model => model.SelectedProjectID)
    @Html.DropDownListFor(model => model.SelectedProjectID, Model.ProjectItems, new { id = "projectID", title = "Select the Project" })
</div>


@(Html.TelerikReporting().ReportViewer()
        .Id("reportViewer1")
            .ServiceUrl("/Reporting/api/Reports/")
            .TemplateUrl("/ReportViewer/templates/telerikReportViewerTemplate.html")
                        .ReportSource(Model.ReportSource)
        .ViewMode(ViewModes.INTERACTIVE)
        .ScaleMode(ScaleModes.SPECIFIC)
        .Scale(1.0)
        .PersistSession(false)
)

<script>
$('#projectID').change(function () {
    var viewer = $("#reportViewer1").data("telerik_ReportViewer");
    viewer.reportSource({
        report: viewer.reportSource().report,
        parameters: { ProjectID: $(this).val() }
    });
    console.log($(this).val());
    viewer.refreshReport();
});
</script>


Select Statement in SQL Data Source
Select * from dbo.Projects  where ProjectID = (SELECT Convert(uniqueidentifier,@ProjectID)) 




Stef
Telerik team
 answered on 21 Feb 2014
3 answers
1.2K+ views

Requirements

RadControls version

Q2 2009
.NET version

2.0
Visual Studio version

2005/2008
programming language C#
browser support

all browsers supported by RadControls


PROJECT DESCRIPTION
This is just a little methode wich exports a report to a file programmatically. So it is possible to export a report without using the ReportViewer.

C#

void ExportToFile(Telerik.Reporting.Report reportToExport, string exportFormat, string exportPath)
{
     ReportProcessor reportProcessor = new ReportProcessor();
     RenderingResult result = reportProcessor.RenderReport(exportFormat, reportToExport, null);

     string fileName = result.DocumentName + "." + exportFormat.ToLower();

     File.WriteAllBytes(exportPath + fileName, result.DocumentBytes);
}

Nasko
Telerik team
 answered on 21 Feb 2014
18 answers
1.1K+ views
Hello,

I have 2 questions about Telerik.Reporting.Table control.

1. Does anyone know how to create table from code level? I mean row with Headers and rows with values below?
2. How to find proper table cell on existing table?

Regards,
Michal.
KS
Top achievements
Rank 1
 answered on 21 Feb 2014
5 answers
620 views
Hello,

I am trying to create a report that filters anything BUT the list of values. I can create one that includes list of values as this:

=Fields.USER_LOCATION In =Split("|", "BH-0019|BH-0030|BH-0019")

But how can not create a filter that filters anything BUT the list of values?

Any help is appreciated.

Thanks!
Shoji Kaburagi
Top achievements
Rank 1
 answered on 20 Feb 2014
12 answers
926 views
Recently we upgraded our version of Telerik Reporting.  In a few of our reports, the way we were accessing the report param selected values in the code behind broke, but we made the necessary corrections to access the parameter values.

However, we still have a scenario where I can't seem to access the values of the report parameters...

We have a aspx page that contains a telerik ReportViewer.  Also on the page, we have a save button - that allows them to save the parameters they have selected in the report that is displayed in the ReportViewer.   So in the code we get the ReportSource of the ReportViewer, and then pull the values of the parameters, and save them to the database.  When we upgraded (to Q1 2013), this stopped working. (the values for the parameters are always null (or the default))

We were accessing the parameter like this:
Telerik.Reporting.IReportDocument document =
   ((Telerik.Reporting.InstanceReportSource)this.ReportViewer1.ReportSource).ReportDocument;
 
foreach (Telerik.Reporting.ReportParameter p in document.ReportParameters)
{
  object value = p.Value;
}   

 

Is there a way of getting the parameter values?


Nasko
Telerik team
 answered on 20 Feb 2014
6 answers
220 views
I have tried reading the documentation provided and searching online, but  i have no idea where to start when it comes to a chart.  I have a sql query generating a report in VS 2010 connecting to a sqldatasource.  I want to create a chart but cannot seem to get it to work properly.  Does anyone know of a good guide or place to get an overview or a video to watch on how this works from start to finish, even on a simple example.  I think once i get the idea i can extrapolate from there. thanks for the help.
Nasko
Telerik team
 answered on 20 Feb 2014
3 answers
131 views
Before using session state in IIS reports worked fine, but then we implement session status reports stopped working. He shows me the following error.

" Unable to serialize the session state. In 'StateServer' and 'SQLServer' mode, ASP.NET will serialize the session state objects, and consequently, non-serializable objects or MarshalByRef are allowed. The same restriction applies if the store custom session state performs a similar serialization in 'Custom' mode. "

I appreciate a prompt response. Thank you.
Stef
Telerik team
 answered on 20 Feb 2014
1 answer
158 views
Hello,

I'm load testing my application right now. It consists of a web app which is calling a WCF Rest service to render the a report in PDF.

When we are sending 5 requets from 5 differents tabs of the browser, we realized that every report are rendered one after the other. As they are large reports about 4 minutes to render. I'm wondering if there is a way to configure the ReportProcessor in order to parallelize the rendering?

Thanks in advance for your help,

See in attachment, a graph of CPU, memory and IO. large IO spikes is basically when the app is writing a report to the disk.

Pierrick
Stef
Telerik team
 answered on 20 Feb 2014
1 answer
144 views
In our main report we have 3 subreports. We need to show the record number for each subreport at the main report footer. How to access the subreport result from the main report? Thank you.
KS
Top achievements
Rank 1
 answered on 19 Feb 2014
1 answer
180 views
       
strSql = @"”;

        DataTable dt = new
DbService().getDT(strSql);

 

        if (dt.Rows.Count > 0)

        {           

            PrintInvoiceRpt Rpt1 = new
PrintInvoiceRpt();

           

 

           

            #region Sub Report BreakDown Query           

 

                        strSql = @"";

 

 

           
Telerik.Reporting.SubReport subRpt =
(Telerik.Reporting.SubReport)Rpt1.Items.Find("subReport1", true)[0];
// Sub Report

can any one suggest me,
 how to add sub report in report book

            DataTable dt_SubReport = new
DbService().getDT(strSql);

            if (dt_SubReport.Rows.Count > 0)

            {

               
subRpt.ReportSource.DataSource = dt_SubReport;

            }

 

 

            #endregion Sub Report BreakDown Query

           

            reportBook.Reports.Add(new PrintInvoiceRpt());

           
reportBook.Reports[0].DataSource = dt;

           
RptViewer.Report = reportBook;           


 

        }

 

 

Main report showing in report book but sub report
not showing ,

How to add subreport of  PrintInvoiceRpt
in report book

I am using Version=5.3.12.119, OR
Q3 2011

 can any one suggest me,how to add subreport in report book


Stef
Telerik team
 answered on 19 Feb 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?