Telerik Forums
Reporting Forum
1 answer
111 views
Hi !
Last time i have a query about the parameters , now i want to know about the AND and OR operator in Filters , By default there is AND operator is there when i add two or more then two parameters , can i replace that AND operator with OR operator ?
Please Reply soon:(

Best Regards

Waqas 
Steve
Telerik team
 answered on 28 Nov 2011
1 answer
240 views
We are working on MVC3 project. We can load the report viewer by using @Html.Partial("ViewPage1").
I want to know , is this possible to load the reportViewer from the template.

I tried the following code, but it doesnt work.  Any ideas?  Thanks.

<script id='downloadDeviceLightboxTemplate' type='text/x-jquery-tmpl'>

<div id='downloadADeviceLightbox'>

<form clientidmode="Static" id="frep" runat="server">

<telerik:ReportViewer ID="ReportViewer1" ToolbarVisible=true runat="server" Report="InfoSmart2.WebSite.Report.InfoSmartReportBook, InfoSmart2.WebSite, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"

Width="100%" Height="900px">

</telerik:ReportViewer>

</form>

</div>

</

 

 

script>




Squall
Top achievements
Rank 1
 answered on 25 Nov 2011
1 answer
264 views
I want to create a dynamic report based on any data-table.  that report provides master-detail report using subreport in report viewer using csharp.
When i create a subreport using a code behind of aspx file i could not bind a subreport.


toggle action not working in dynamic report  . 

If u have a any idea about this please share your thoughts here...


Here my code:


 DataTable data = GetData().Tables[0];
            int colsCount = data.Columns.Count;
            int RowsCount = data.Rows.Count;
            Telerik.Reporting.Drawing.Unit globalRowHeight = new Telerik.Reporting.Drawing.Unit(0.28, Telerik.Reporting.Drawing.UnitType.Inch);
            Telerik.Reporting.PageHeaderSection PageHeader = new Telerik.Reporting.PageHeaderSection();
            Telerik.Reporting.ReportHeaderSection ReportHeaderSection = new Telerik.Reporting.ReportHeaderSection();
            Telerik.Reporting.GroupHeaderSection LabelsGroupHeader = new Telerik.Reporting.GroupHeaderSection();
            Telerik.Reporting.DetailSection Detail = new Telerik.Reporting.DetailSection();
            Telerik.Reporting.GroupFooterSection labelsGroupFooter = new Telerik.Reporting.GroupFooterSection();
            Telerik.Reporting.ReportFooterSection ReportFooterSection = new Telerik.Reporting.ReportFooterSection();
            Telerik.Reporting.PageFooterSection PageFooterSection = new Telerik.Reporting.PageFooterSection();
            Telerik.Reporting.SubReport Subreport1 = new Telerik.Reporting.SubReport();

            ReportHeaderSection.Height = globalRowHeight;


            Telerik.Reporting.Panel MasterDetailPanel = new Telerik.Reporting.Panel();
            MasterDetailPanel.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0.28, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.3, Telerik.Reporting.Drawing.UnitType.Inch));
            MasterDetailPanel.Size = new SizeU(new Telerik.Reporting.Drawing.Unit(0.42, Telerik.Reporting.Drawing.UnitType.Cm), globalRowHeight);
            MasterDetailPanel.Style.BorderStyle.Default = BorderType.Solid;
            MasterDetailPanel.KeepTogether = true;
            MasterDetailPanel.Style.BackgroundColor = Color.CadetBlue;
            ReportHeaderSection.Style.BackgroundColor = Color.CadetBlue;

            Telerik.Reporting.Panel SubDetailPanel = new Telerik.Reporting.Panel();
            SubDetailPanel.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0.28, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.4, Telerik.Reporting.Drawing.UnitType.Inch));
            SubDetailPanel.Size = new SizeU(new Telerik.Reporting.Drawing.Unit(0.42, Telerik.Reporting.Drawing.UnitType.Cm), globalRowHeight);
            SubDetailPanel.Style.BorderStyle.Default = BorderType.Solid;
            SubDetailPanel.KeepTogether = true;
            SubDetailPanel.Style.BackgroundColor = Color.BlanchedAlmond;
            for (int i = 0; i < colsCount; i++)
            {
                // ReportHeaderSection.........Start...
                Telerik.Reporting.TextBox SingleTextBox = new Telerik.Reporting.TextBox();
                SingleTextBox.Value = data.Columns[i].ColumnName.ToString();
                SingleTextBox.CanGrow = true;

                SingleTextBox.Style.BorderStyle.Default = BorderType.Solid;
                SingleTextBox.Multiline = true;
                SingleTextBox.KeepTogether = true;
                SingleTextBox.TextWrap = true;
                SingleTextBox.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Left;
                SingleTextBox.Size = new SizeU(new Telerik.Reporting.Drawing.Unit(5, Telerik.Reporting.Drawing.UnitType.Inch), globalRowHeight);
                SingleTextBox.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(i - 0.8, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(0.2, Telerik.Reporting.Drawing.UnitType.Cm));
                ReportHeaderSection.Items.AddRange(new Telerik.Reporting.ReportItemBase[] { SingleTextBox });
                // ReportHeaderSection.........End...
                //Detail ....................Start....
                Telerik.Reporting.TextBox MasterDetailTextBox = new Telerik.Reporting.TextBox();
                MasterDetailTextBox.Value = "=Fields." + data.Columns[i].ColumnName.ToString();
                MasterDetailTextBox.CanGrow = true;
                MasterDetailTextBox.Multiline = true;
                MasterDetailTextBox.KeepTogether = true;
                MasterDetailTextBox.TextWrap = true;
                MasterDetailTextBox.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Left;
                MasterDetailTextBox.Size = new SizeU(new Telerik.Reporting.Drawing.Unit(5, Telerik.Reporting.Drawing.UnitType.Inch), globalRowHeight);
                MasterDetailTextBox.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(i - 0.6, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(0.2, Telerik.Reporting.Drawing.UnitType.Cm));


                MasterDetailPanel.Items.AddRange(new Telerik.Reporting.ReportItemBase[] { MasterDetailTextBox });

                //  Detail.Items.AddRange(new Telerik.Reporting.ReportItemBase[] { MasterDetailTextBox });
                //Detail ....................End....

            }
             ClassLibrary1.Subreport subreport = new ClassLibrary1.Subreport();
            Subreport1.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0.28, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.4, Telerik.Reporting.Drawing.UnitType.Inch));
            Subreport1.Parameters.Add(new Telerik.Reporting.Parameter("Vendor_Code", null));
            Subreport1.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(5.7000007629394531, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(1.7000001668930054, Telerik.Reporting.Drawing.UnitType.Inch));
            //Subreport1.ReportSource.DataSource = GetData().Tables[0];
            Subreport1.ReportSource = subreport;
            Subreport1.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0.28, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.5, Telerik.Reporting.Drawing.UnitType.Inch));
            Subreport1.NeedDataSource += new EventHandler(Subreport1_NeedDataSource);





            //  Detail.Items.AddRange(new Telerik.Reporting.ReportItemBase[] { MasterDetailPanel });
            Detail.Height = new Telerik.Reporting.Drawing.Unit(0.42926517128944397D, Telerik.Reporting.Drawing.UnitType.Inch);
            Detail.Items.AddRange(new Telerik.Reporting.ReportItemBase[] { Subreport1, MasterDetailPanel, SubDetailPanel });
            Detail.Style.BackgroundColor = Color.BurlyWood;
            //  Detail.Items.AddRange(new Telerik.Reporting.ReportItemBase[] { Subreport1 });            


            Telerik.Reporting.ToggleVisibilityAction toggleVisibilityAction1 = new Telerik.Reporting.ToggleVisibilityAction();
            MasterDetailPanel.Action = toggleVisibilityAction1;
            toggleVisibilityAction1.DisplayExpandedMark = false;
            toggleVisibilityAction1.Targets.AddRange(new Telerik.Reporting.IToggleVisibilityTarget[] { SubDetailPanel });


            PageFooterSection = new Telerik.Reporting.PageFooterSection();
            PageFooterSection.Height = new Telerik.Reporting.Drawing.Unit(0.3, Telerik.Reporting.Drawing.UnitType.Inch);
            PageFooterSection.Style.BackgroundColor = Color.Brown;
            PageFooterSection.PrintOnFirstPage = true;
            PageFooterSection.PrintOnLastPage = true;
            Telerik.Reporting.TextBox txtFooter = new Telerik.Reporting.TextBox();
            txtFooter.Value = "='Page ' + PageNumber + ' of ' + PageCount";
            txtFooter.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(4.2395832538604736D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.02083333395421505D, Telerik.Reporting.Drawing.UnitType.Inch));
            txtFooter.Name = "pageInfoTextBox";
            txtFooter.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(5.5603775978088379D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.20000000298023224D, Telerik.Reporting.Drawing.UnitType.Inch));
            //Telerik.Reporting.PictureBox picBoxFooter = new Telerik.Reporting.PictureBox();
            //picBoxFooter.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0.2395832538604736D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.02083333395421505D, Telerik.Reporting.Drawing.UnitType.Inch));
            //picBoxFooter.Value = @"Images\no.png";
            //picBoxFooter.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Center;
            //picBoxFooter.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(1, ((Telerik.Reporting.Drawing.UnitType)(Telerik.Reporting.Drawing.UnitType.Inch))), new Telerik.Reporting.Drawing.Unit(.5D, ((Telerik.Reporting.Drawing.UnitType)(Telerik.Reporting.Drawing.UnitType.Inch))));
            //picBoxFooter.Sizing = ImageSizeMode.AutoSize;
            PageFooterSection.Items.AddRange(new Telerik.Reporting.ReportItemBase[] { txtFooter });
            Report Report = new Report();
            Report.DataSource = data;



            Report.Items.Add((ReportItemBase)PageHeader);
            Report.Items.Add((ReportItemBase)ReportHeaderSection);
            //   Report.Items.Add((ReportItemBase)LabelsGroupHeader);           
            Report.Items.Add((ReportItemBase)Detail);
            Report.Items.Add((ReportItemBase)labelsGroupFooter);
            Report.Items.Add((ReportItemBase)ReportFooterSection);
            Report.Items.Add((ReportItemBase)PageFooterSection);

            ReportViewer1.Report = Report;

        
        }
        
Peter
Telerik team
 answered on 25 Nov 2011
1 answer
266 views
Dear

I am building the Chart in the Reporting, i am manually binding the data using a data table, in that total 3 columns i want to set one to X axis and other to Y axis and another to Secondary Y axis,

I am tring to bind it, but its not taking the Secondary Y axis...

I am using in this manner
 rpt.Chart1.Series(0).PlotArea.YAxis.YAxisType = Telerik.Charting.ChartYAxisType.Secondary

Waiting For the Replay...

Thanks 
Purna
Elian
Telerik team
 answered on 25 Nov 2011
1 answer
303 views
I am getting WCF service exception when I am trying to add huge data to report parameter, if we send small chunk of data its working fine. do verify my code and suggest me the right way to add parameter data. Added web.config setting along with the reportviewer code.
<bindings>
      <customBinding>
        <binding name="BinaryHttpBinding">
          <binaryMessageEncoding>
            <readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647"
              maxBytesPerRead="2147483647" maxNameTableCharCount="16384" />
          </binaryMessageEncoding>
          <httpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />
        </binding>
      </customBinding>
</bindings>

public partial class ReportViewer : Page, IReportServiceClientFactory
   {
       public ReportSettingsDTO ReportParametersObject { get; set; }
       public ReportViewer()
       {
           InitializeComponent();
           this.rptViewer.ReportServiceClientFactory = this;
           this.rptViewer.Report = "WebClient.Reports.TestReport, WebClient";
           this.rptViewer.RenderBegin += new RenderBeginEventHandler(rptViewer_RenderBegin);
       }
 
       void rptViewer_RenderBegin(object sender, RenderBeginEventArgs args)
       {
           args.ParameterValues["ParameterObject"] = serialize();
       }
       public string serialize()
       {
           MemoryStream ms = new MemoryStream();
 
           // Serializer the User object to the stream.
           DataContractSerializer ser = new DataContractSerializer(typeof(ReportSettingsDTO));
           ser.WriteObject(ms, ReportParametersObject);
           byte[] array = ms.ToArray();
           ms.Close();
           return Encoding.UTF8.GetString(array, 0, array.Length);
       }
 
       #region IReportServiceClientFactory Members
 
       ReportServiceClient IReportServiceClientFactory.Create(System.Uri remoteAddress)
       {
           var binding = new BasicHttpBinding()
           {
               TransferMode = System.ServiceModel.TransferMode.Buffered,
               MaxBufferSize = int.MaxValue,
               MaxReceivedMessageSize = int.MaxValue,
               OpenTimeout = new TimeSpan(0, 15, 0),
               ReceiveTimeout = new TimeSpan(0, 15, 0),
               SendTimeout = new TimeSpan(0, 15, 0)
           };
 
           var endpointAddress = new EndpointAddress(remoteAddress);
 
           return new ReportServiceClient(binding, endpointAddress);
       }
 
 
       #endregion
   }
Steve
Telerik team
 answered on 25 Nov 2011
1 answer
82 views
hi !
can any one please guide me that how to pass parameters in telerik , please also give any example so that i can easily understand it , as i am very new in telerik reporting .

Best Regards

Waqas
Steve
Telerik team
 answered on 25 Nov 2011
3 answers
186 views
Hello, I am trying out Telerik reporting and am attempting to learn how to bind to a line Graph. Here is my situation:

-I have a table of transactions, each of which has a "category"
-I have a parameter which is a date
-I want my line graph to show the count of each "category" for each of the last 7 days. So I want a series (line) for each "Category", where my x-axis is the day (7 days ago to now)  and the y-axis is the count of transactions for that category.

My problem is that I do not know "what" categories these may be before-hand. I tried using a "pivot" in my sql query: this gives me a result set with each day as columns and counts for each category. I cannot create my line series in the design view because I don't know the categories (could be 2, 15 ect.)

Is there a way, after the chart is bound to this result set, to get that set, iterate through it, construct a "custom" result set with the "categories" as columns,  and programatically add the series to construct the chart?  Thanks so much
Elian
Telerik team
 answered on 24 Nov 2011
1 answer
72 views
Hello,

We  have application where we generate line chart. The dataset which is binded to the chart has 15 rows and 31 columns. When the columns are less chart gets rendered quickly but with more number of columns it takes almost 3-4 mins. Please let me know what can be done to resolve this issue.

Thanks.

Elian
Telerik team
 answered on 24 Nov 2011
1 answer
170 views
During installation of Telerik Reporting Q3 2011 I got the error "Setup Wizard ended prematurely" without any hints to the problem causing that error.

I've found that there was an error in XML-syntax in file:
C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config
(Opening that file in the internet-explorer gives an indication of the faulty line.)

In my case there was a question mark (?) instead of the closing quotation marks (") in the line:
<add name="Npgsql Data Provider" invariant="Npgsql"  support="FF" 
description=".Net Framework Data Provider for Postgresql Server" 
type="Npgsql.NpgsqlFactory, Npgsql, Version=2.0.11.0, Culture=neutral
PublicKeyToken=5d8b90d52f46fda7"/>

Steve
Telerik team
 answered on 24 Nov 2011
3 answers
1.0K+ views
is there any way to customize the papper size in the reports? i mean no predefined papper size on windows, i have my custom size of papper since im using a matrix dots printer
Steve
Telerik team
 answered on 24 Nov 2011
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?