Telerik Forums
Reporting Forum
7 answers
694 views
I have a DateTime field in my database that allows nulls.  When I bring the records up to the UI, they come up as DateTime? properties on an object.  I have put "=Fields.<DateField>.Value" in the Textbox.Value, but when displaying the report, the textbox shows an error that '.Value' is not valid.

I would like to put =Iif(Fields.DateField.HasValue,Fields.DateField.Value,""), but cannot get anything to work...

Is something like that allowed?
Steve
Telerik team
 answered on 29 Nov 2011
3 answers
137 views
Dear Team,

In the telerik Reporting we have an option,  convert to Pdf 

When i convert my the report containing Chart it not fitting in one page,  

While convert to PDF i need to change any setting to fit to one page.


Thanks in advance

Best Regards
Purna.
Elian
Telerik team
 answered on 29 Nov 2011
1 answer
206 views
I'm trying to build a telerik report programmatically, but I can't find ShapeType = SquareShape (in Telerik.Reporting.Drawing.Shapes). Square is a shapetype in report designer. Anybody who knows how to create squares programmatically?
Elian
Telerik team
 answered on 29 Nov 2011
13 answers
944 views
Hello,

I'm developing web app where each user have his own database, so I'm creating report datasource in code.

Example:
        Dim cnn As New OracleConnection(Session("cnnString").ToString)
        Dim sql As String = "SELECT * FROM sometable"
        Dim adapter As New OracleDataAdapter(sql, cnn)
        Dim table As New DataTable
        adapter.Fill(table)

        Dim report As New Reports.MyReport
        report.DataSource = table

That report have one subreport, but I don't know how to set subreport's datasource in code.

Thanks,

Marin Mašić
Mohamed
Top achievements
Rank 1
 answered on 29 Nov 2011
2 answers
91 views
We have a simple report, that lists people by group and gender. The report combines a table and a chart. The table appears accurately, but the chart seems to move the values around so that the values appear under different groups. You can see what I mean from the attached screen shot.

The chart is configured as follows; default type is stacked bar, xaxis.datalabelscolumn is groupname, datagroupcolumn  is gender.

The data source has three columns; groupname, gender, and a count.
ACFN    Male    1
FMFN    Female    1
FMFN468    Female    1
N-CAN    Male    1
OABO    Male    2
OCAN    Male    1
OLNA    Male    1

Both genders don't always show up in the result set for any specific group; could that be the issue?

Any and all suggestions are appreciated.
Derek
Top achievements
Rank 1
 answered on 28 Nov 2011
1 answer
103 views
I am currently trialing the Telerik reporting tool.
I have successfully created a cross tab report which is fine as long as I don't set the data source at runtime.
If I set the data source at runtime the report loses its groupings.

I have tried setting the grouping again in code but it makes no difference.
Could someone please tell me what I am doing wrong?

Cheers

Jason

Code
            OCMBusinessLogic logic = new OCMBusinessLogic();
            IList<AOSMatrix> matrixdata = null;


            matrixdata = logic.GetAOSMatrix("11/12", "ba_eng");


            MessageBox.Show("Rows " + matrixdata.Count.ToString());


            AOSModuleMatrix rpt = null;
            rpt = new AOSModuleMatrix();
            rpt.ReportParameters["ReportTitle"].Value = "Programme matrix for [programme family]";


            Telerik.Reporting.Group grp = new Telerik.Reporting.Group();
            grp.Name = "AOS";
            grp.Groupings.Add(new Telerik.Reporting.Data.Grouping("=Fields.AOScode"));
            rpt.Groups.Add(grp);
            rpt.DataSource = matrixdata;


            ReportProcessor reportProcessor = new ReportProcessor();
            Hashtable deviceinfo = new Hashtable();
            deviceinfo["FontEmbedding"] = "Subset";
            RenderingResult result = reportProcessor.RenderReport("PDF", rpt, deviceinfo);


            FileStream fs = new FileStream("c:\\telerik.pdf", FileMode.Create);
            fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);
            fs.Flush();
            fs.Close();


            MessageBox.Show("Generated");

Elian
Telerik team
 answered on 28 Nov 2011
0 answers
99 views
hi!

i don't have sql server on my computer but i still want to see the source code of the demos that come with the MSI file. How can i have access to them?

I think it would be great if the demos could be installed without any instance of SQL Server! But in the meantime, is it possible to download them somewhere?

alex
Alexandre Jobin
Top achievements
Rank 1
 asked on 28 Nov 2011
1 answer
88 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
187 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
226 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
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?