Telerik Forums
Reporting Forum
1 answer
205 views

Hi,

I would like to know if it's possible to hide elements when printing.

Scenario:

I have a report consisting of a table. One of the columns in this table have a link that I do not want to show when printing the report. Is this possible?

Thanks.

Katia
Telerik team
 answered on 08 Jun 2016
3 answers
164 views

Hi,

 

I have a horizontal bar graph, with varying amount of data in it. Is there any feature or property I can set, either in code or within the reportviewer directly , so that the graph.container will resize accordingly?

Thanks in advance!

 

Regards,

Shreyas Menon.

Stef
Telerik team
 answered on 08 Jun 2016
7 answers
2.4K+ views
I created a report in the report designer.
I have a parameter for a report that connects to a datasource.
It pulls back a list of items from which the user can select one to run the report against.
That parameter pulls its data from a datasource that I added via the report designer.
I added the resulting trdx file to my winForms visual studio project.
I need to be able to change the connection string of the datasource the parameter is using at run time.
I was able to deserialize the trdx file easily enough with some code I found here in this forum.
But I could not figure out how to change the connectionstring for a parameter's datasource.
How would I go about doing that?

Thanks,Jim
Al
Top achievements
Rank 1
Iron
Iron
Iron
 answered on 08 Jun 2016
8 answers
414 views
Hi,

I create a report using standalone report designer. There are a lot of datasources in my report which I add by clicking Data->SQL Data Source. Reports created will be run on reportviewer. While running report, connectionstring for all the datasources in the report should be changed. Following is a piece of my asp.net code. 

string report_key = Request.QueryString["Report"];
                if (report_key == null)
                    Response.Redirect("reports.aspx");
                else
                {
                    string ConnectionString = newConn;
                    string ConnectionStringRedemption = "";
                    string userName = ParafaitCommon.getUserName();
                    string role = ParafaitCommon.getRole();
                    long userId = ParafaitCommon.getUserId();
                    string fromDate = ParafaitTimezone.getLocalTime(DateTime.Now.AddDays(-1)).ToString("MM/dd/yyyy") + " 06:00:00 AM";
                    string toDate = ParafaitTimezone.getLocalTime(DateTime.Now).ToString("MM/dd/yyyy") + " 06:00:00 AM";
                    
                    Telerik.Reporting.UriReportSource URI = new Telerik.Reporting.UriReportSource();
                    try
                    {
                        if (report_key.Contains("Dynamic Report"))
                            URI.Uri = "Dynamic Report.trdx";
                        else
                            URI.Uri = report_key + ".trdx";

                        XmlReaderSettings settings = new XmlReaderSettings();
                        settings.IgnoreWhitespace = true;
                        using (XmlReader xmlReader = XmlReader.Create(Server.MapPath(URI.Uri), settings))
                        {
                          Telerik.Reporting.XmlSerialization.ReportXmlSerializer xmlSerializer =
                                                new Telerik.Reporting.XmlSerialization.ReportXmlSerializer();

                          Telerik.Reporting.Report report = (Telerik.Reporting.Report)xmlSerializer.Deserialize(xmlReader);
                          (report.DataSource as SqlDataSource).ConnectionString = newConn;
                          rptViewer.Report = report;
                          rptViewer.ReportSource.Parameters.Add("fromdate", fromDate);
                          rptViewer.ReportSource.Parameters.Add("todate", toDate);
                          rptViewer.ReportSource.Parameters.Add("offSet", Convert.ToString(ParafaitTimezone.FinalOffset()));
                          rptViewer.ReportSource.Parameters.Add("user", userName);
                          rptViewer.ReportSource.Parameters.Add("loggedInUserName", userName);
                          rptViewer.ReportSource.Parameters.Add("role", role);
                          rptViewer.ReportSource.Parameters.Add("loggedInUserId", userId.ToString());
                          if (ParafaitCommon.checkIsCorporate())
                              rptViewer.ReportSource.Parameters.Add("isCorporate", "Y");
                          else
                              rptViewer.ReportSource.Parameters.Add("isCorporate", "N");
                          rptViewer.RefreshReport();
                        }
                    }
                    catch
                    {

                    }
                }
            }

After the statement, Telerik.Reporting.Report report = (Telerik.Reporting.Report)xmlSerializer.Deserialize(xmlReader);
report.Datasource has value null.

In case I add datasource following report wizard, report.Datasource has value but only for the datasource that I create using the wizard. I need to change connectionstring for all the datasources in the report. How do I add multiple datasources and change connectionstring for all of them. I attach a sample report for reference.
john
Top achievements
Rank 1
 answered on 08 Jun 2016
3 answers
709 views

Hi,

        I am new in using Telerik reporting and considering moving from Crystal Report. I need help on display subreport data in WPF VS 2015. The application able to display the master report data but it doesn't show subreport data after added code for subreport. Below is my sample code.

 

      private void frmMainWindowB_Loaded(object sender, RoutedEventArgs e)
        {
            //Get data
            var objectDataSourceSub = new Telerik.Reporting.ObjectDataSource();
            objectDataSourceSub.DataSource = GetSubData1(); // GetData returns a DataTable

            var objectDataSourceMain = new Telerik.Reporting.ObjectDataSource();
            objectDataSourceMain.DataSource = GetMainData(); // GetData returns a DataTable
            //


            var mainreport = new MyReportLib.SampleBMainRpt();   

            var Bsubrpt1 = new MyReportLib.SampleBSubReport1();
            
            Telerik.Reporting.SubReport subreport1 = mainreport.Items.Find("subReport1", true).FirstOrDefault() as Telerik.Reporting.SubReport;
            
            var reportSource = new Telerik.Reporting.InstanceReportSource();
            reportSource.ReportDocument = mainreport;
            mainreport.DataSource = objectDataSourceMain;

            var SUBreportSource = new Telerik.Reporting.InstanceReportSource();
            Bsubrpt1.DataSource = objectDataSourceSub;
            SUBreportSource.ReportDocument = Bsubrpt1;

            subreport1.ReportSource = Bsubrpt1;
            
            reportViewerB.ReportSource = reportSource;
            reportViewerB.RefreshReport();

        }

 

Katia
Telerik team
 answered on 07 Jun 2016
1 answer
60 views
The Silverlight report viewer control never clears the cache out of the database. Steps to reproduce:

1. Configure the database cache provider with mssql as defined in the documentation.

2. View a report by setting the Report property of the viewer with the class name of the report.

3. Clear the report when the user is done viewing the report by setting the Report property of the viewer to null.

I see the request to invalidate the report session, but the cached data remains in the database.

Raw request:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><RenderAndCache xmlns="Telerik.ReportService"><format></format><report></report><deviceInfo xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><d4p1:KeyValueOfstringanyType><d4p1:Key>InvalidSessions</d4p1:Key><d4p1:Value xmlns:d6p1="http://www.w3.org/2001/XMLSchema" i:type="d6p1:string">["035e4409-655c-49ab-a5b0-b9bf5e0d9859"]</d4p1:Value></d4p1:KeyValueOfstringanyType></deviceInfo><parameters xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" i:nil="true" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" /></RenderAndCache></s:Body></s:Envelope>

Stef
Telerik team
 answered on 07 Jun 2016
3 answers
140 views

Hi,

I have hooked up an extender to my entity framework model and the dll I use has a public DbContext object. In the Data Explorer of the report designer I see all my entity objects/tables just fine but I don't see any of the columns ie. I can only drag the entire table onto my report and then in preview I just get a series of sql statements as below, but I cannot drag individual columns and I cannot see the actual data in my report:

Select [Extent1].[ID] as [ID],

Select [Extent1].[Name] as [Name],..... etc.

 

What am I doing wrong here?

Stef
Telerik team
 answered on 07 Jun 2016
17 answers
1.7K+ views
I have a master report with 10 subreports that may or may not have sub reports

If I view each subreport individually, i don't see any blank pages with the data, however if i view the subreports via the master page, i get a blank page with each page of data

in the beginning i noticed this trend due to the margins and i have explicitly set the master page's margin to 0 all around yet am still seeing this problem

any help would be much appreciated!
Stef
Telerik team
 answered on 06 Jun 2016
1 answer
759 views

Hi,

i have created a report with RTF template using XML Publisher. when i run the report in pdf format then its showing blank page as the first page followed by the actual report content.
i have already gone through solution given under "Problem: Telerik Reporting renders blank pages" blog but did not find it applicable to my report issue.

please share if any suggestions.

Best Regards,

Stef
Telerik team
 answered on 06 Jun 2016
1 answer
282 views

I have a telerik report, it looks fine on screen but when I go to print it the margins default to 25mm, very helpful NOT.

 

It also does the does the same when I export the report as a PDF, it ignores the margins.
The report has the following margins

Anyone got any ideas ? I need the margins to 1mm
Katia
Telerik team
 answered on 06 Jun 2016
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?