Telerik Forums
Reporting Forum
3 answers
109 views
I have a report that shows some data via text boxes and a picturebox.

After this I want to have some more data. This next set of data so far is running through a table. In the test report I built, the column count works fine(I want it to take up 2/3 columns), but once I put this in another report via subReport, it fails to read the columncount. How do I get around this? 



Or can I have two seperate reports that I merge together at runtime? How would I go about doing that?
Steve
Telerik team
 answered on 17 May 2011
1 answer
39 views
Just wondering if this is within the capabilities of Telerik Reporting.
I have a list of images to display along with a list of comments about the image.
I tried using a crosstab, but the formatting comes out wrong, with inconsistent image size (Xtab.jpg)
I would like it to appear with the image on the left, with the comments on the right (Mockup.jpg).

If this isn't possible, any ideas how an image with multiple comments can be formatted to display nicely in a report?
I tried using 2 columns in the report, but some comments get separated from the picture when the report continues on the second column
Steve
Telerik team
 answered on 17 May 2011
0 answers
88 views
Hi there,

if anyone is interested:
I build a little tool to mak elocalization for Telerik Reporting easier.
We are working on a big project and the most localization for that project is already done, until now in 7 different languages. So I thougth that it would be a nice goal to use this for Reporting, because then we do not need to do the work twice.
My tool works this way:
First I create a report and name the fields that should be localized exactly like they are named in the resx-files of the project.
After that i start my tool and set the configuration: that means: Projectname, sourcefolder of the resx-files, targetfolder of the report-resx-files and fileextension if I use resource instead of resx, and how I indent the files (tab or spaces).
My tool now load the report.resx and after that every resx in the sourcefolder, search for translations needed for the report.resx, added a .value to the name and set the value.
After that, I locate the projectfile and add the resx-files as embeddedsource.
Now starting my reportproject and all localizations are there.

If anyone is interested in that tool, please let me know.

Best regards
Manfred
Manfred
Top achievements
Rank 2
 asked on 17 May 2011
1 answer
69 views
Telerix Reporting Q1 2001
Silverlight 4
Visual Studio 2010 SPK1
RIA Services
SQL Server 2008

I'm currently working on an Application using the above items.
I need to add reporting the application.
I cannot find any examples using RIA Services and having the end user filter the report from a Silverlight Page.

Could someone please help.

Thank You
Steve
Telerik team
 answered on 17 May 2011
2 answers
165 views
Hi,

I am using Telerik Reports with my Silverlight 4 application.  I have 2 parameters that are dependent lists (like the Country - State/Province scenario).  I don't want to force the user to have to choose either so I have selected Allow Blank for each, but when I select either at runtime, the blank options disappear so then the user would have to make a selection.  To try to get around this, I have added to each of these lists a member that says "(All)" and has a value of 0, so the user can have a report showing all the values.  I have filtered the second list to equal the Id of the first list as you described in your Cascading example but I need the "(All)" to be always available.  I could do this if the Filters had an OR option but I can only see AND.  What I am trying to achieve is the user could choose: (All countries and all States/Provinces), or (Australia and all States), or (Australia and Victoria).  How can I achieve this?

Please help.
Steve
Telerik team
 answered on 17 May 2011
3 answers
162 views
hi all.

I am doing a report and I have a subreport inside. That their report is in three columns of results, but in the report since he called me and puts a column in a new page, not the size that includes me tell you.

as can be done. Attached images.
blaise
Top achievements
Rank 1
 answered on 17 May 2011
3 answers
246 views
I have added a report and table dynamically, my dataset has 10 rows but when the report renders, it has just header, no data is rendered
I used the AutoGenerateColumns project

Here is the code

public void RenderReport()
        {
            Telerik.Reporting.Report report1 = new Telerik.Reporting.Report();
            //report1.DataSource = DataSource;

            styleRule = new Telerik.Reporting.Drawing.StyleRule();
            //Add a TypeSelector
            styleRule.Selectors.AddRange(new Telerik.Reporting.Drawing.ISelector[] { new Telerik.Reporting.Drawing.TypeSelector(typeof(Telerik.Reporting.TextBox)), new Telerik.Reporting.Drawing.TypeSelector(typeof(Telerik.Reporting.HtmlTextBox)) });
            //Add formatting
            styleRule.Style.Font.Name = "Courier New";
            styleRule.Style.Font.Size = Telerik.Reporting.Drawing.Unit.Inch(.5);
            //Add rule to Style Sheet
            report1.StyleSheet.AddRange(new Telerik.Reporting.Drawing.StyleRule[] { styleRule });

            table1  = new Telerik.Reporting.Table();
            table1.ColumnHeadersPrintOnEveryPage = true;
            table1.ColumnGroups.Clear();
            table1.Body.Columns.Clear();
            table1.Body.Rows.Clear();
            table1.DataSource = DataSource;
            table1.ItemDataBinding += new EventHandler(table_ItemDataBinding);

            string sortCol = "";
            string sortDir = "";
            if (SortDescriptors.Count > 0)
            {
                ColumnSortDescriptor sd = SortDescriptors[0] as ColumnSortDescriptor;
                sortCol = sd.Column.UniqueName;
                sortDir = sd.SortDirection.ToString();
            }
            //Page Header Section
            Telerik.Reporting.PageHeaderSection pageHeaderSection1 = new Telerik.Reporting.PageHeaderSection();
            if (ShowPageHeader)
            {
                pageHeaderSection1.Height = new Telerik.Reporting.Drawing.Unit(0.3, Telerik.Reporting.Drawing.UnitType.Inch);
                pageHeaderSection1.Style.BackgroundColor = Color.Gray;
                Telerik.Reporting.TextBox txtHead = new Telerik.Reporting.TextBox();
                txtHead.Value = "Title";
                txtHead.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(3.2395832538604736D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.02083333395421505D, Telerik.Reporting.Drawing.UnitType.Inch));
                txtHead.Name = "reportTitle";
                txtHead.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));
                pageHeaderSection1.Items.AddRange(new Telerik.Reporting.ReportItemBase[] { txtHead });
            }
            int count = ColumnCollection.Where(p => p.ColIsVisible == true).Count();

            Telerik.Reporting.Drawing.Unit x = Telerik.Reporting.Drawing.Unit.Inch(0);
            Telerik.Reporting.Drawing.Unit y = Telerik.Reporting.Drawing.Unit.Inch(0);

            Telerik.Reporting.ReportItemBase[] headColumnList = new Telerik.Reporting.ReportItem[count];
            Telerik.Reporting.ReportItemBase[] detailColumnList = new Telerik.Reporting.ReportItem[count];

            Telerik.Reporting.Group group = new Telerik.Reporting.Group();

 

            Telerik.Reporting.ReportItemBase[] groupColumnList = new Telerik.Reporting.ReportItem[GroupDescriptor.Count];
            int i = GroupDescriptor.Count;
            if (GroupDescriptor.Count > 0)
            {
                Telerik.Reporting.GroupHeaderSection groupHeaderSection1 = new Telerik.Reporting.GroupHeaderSection();
                foreach (ColumnGroupDescriptor grpDescriptor in GroupDescriptor)
                {
                    string grpCol = grpDescriptor.Column.UniqueName;
                    group.Groupings.Add(new Telerik.Reporting.Data.Grouping("=Fields." + grpCol));
                    if (grpDescriptor.SortDirection.ToString().ToLower() == "descending")
                    {
                        group.Sortings.Add(new Telerik.Reporting.Data.Sorting("=Fields." + grpCol, Telerik.Reporting.Data.SortDirection.Desc));
                    }
                    else
                    {
                        group.Sortings.Add(new Telerik.Reporting.Data.Sorting("=Fields." + grpCol, Telerik.Reporting.Data.SortDirection.Asc));
                    }
                    i--;
                    Telerik.Reporting.TextBox hdCol = new Telerik.Reporting.TextBox();
                    hdCol.Style.BackgroundColor = Color.Orange;
                    hdCol.Style.BorderStyle.Default = BorderType.Solid;
                    hdCol.Style.BorderWidth.Default = Unit.Pixel(1);
                    hdCol.KeepTogether = true;
                    hdCol.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));
                    hdCol.Value = "=[" + grpCol + "]"; ;
                    groupColumnList[i] = hdCol;
                    group.GroupHeader = groupHeaderSection1;
                    group.GroupHeader.Height = Telerik.Reporting.Drawing.Unit.Inch(0);

                }
                groupHeaderSection1.Items.AddRange(groupColumnList);
            }

            if (sortCol.Length > 0)
            {
                group.Groupings.Add(new Telerik.Reporting.Data.Grouping("=Fields." + sortCol));
                if (sortDir.ToLower() == "descending")
                {
                    group.Sortings.Add(new Telerik.Reporting.Data.Sorting("=Fields." + sortCol, Telerik.Reporting.Data.SortDirection.Desc));
                }
                else
                {
                    group.Sortings.Add(new Telerik.Reporting.Data.Sorting("=Fields." + sortCol, Telerik.Reporting.Data.SortDirection.Asc));
                }
            }

 

            //Detail Section
            Telerik.Reporting.DetailSection detailSection1 = new Telerik.Reporting.DetailSection();
            detailSection1.Height = new Telerik.Reporting.Drawing.Unit(2D, Telerik.Reporting.Drawing.UnitType.Inch);
            detailSection1.Items.AddRange(new ReportItemBase[] { table1 });

 

            //Page Footer Section
            Telerik.Reporting.PageFooterSection pageFooterSection1 = new Telerik.Reporting.PageFooterSection();
            if (ShowPageFooter)
            {
                pageFooterSection1.Height = new Telerik.Reporting.Drawing.Unit(0.3, Telerik.Reporting.Drawing.UnitType.Inch);
                pageFooterSection1.Style.BackgroundColor = Color.LightGray;
                pageFooterSection1.PrintOnFirstPage = true;
                pageFooterSection1.PrintOnLastPage = true;
                Telerik.Reporting.TextBox txtFooter = new Telerik.Reporting.TextBox();
                if (ShowPageNumber)
                {
                    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)); //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(1, ((Telerik.Reporting.Drawing.UnitType)(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(5.2395832538604736D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.02083333395421505D, Telerik.Reporting.Drawing.UnitType.Inch));
                picBoxFooter.Value = @"C:\CCMSGoldStandard_Local\CCMSGoldStandard\CCMSAppShell\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;

                pageFooterSection1.Items.AddRange(new Telerik.Reporting.ReportItemBase[] { txtFooter, picBoxFooter });
            }
            //add all section to report
            report1.Items.AddRange(new Telerik.Reporting.ReportItemBase[] { pageHeaderSection1, detailSection1, pageFooterSection1 });

            report1.PageSettings.Landscape = false;
            report1.PageSettings.Margins.Bottom = new Telerik.Reporting.Drawing.Unit(1D, Telerik.Reporting.Drawing.UnitType.Inch);
            report1.PageSettings.Margins.Left = new Telerik.Reporting.Drawing.Unit(.25, Telerik.Reporting.Drawing.UnitType.Inch);
            report1.PageSettings.Margins.Right = new Telerik.Reporting.Drawing.Unit(.25, Telerik.Reporting.Drawing.UnitType.Inch);
            report1.PageSettings.Margins.Top = new Telerik.Reporting.Drawing.Unit(1D, Telerik.Reporting.Drawing.UnitType.Inch);
            Telerik.Reporting.Drawing.SizeU paperSize = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(25, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(22, Telerik.Reporting.Drawing.UnitType.Inch));
            report1.PageSettings.PaperSize = paperSize;
            report1.PageSettings.PaperKind = System.Drawing.Printing.PaperKind.Custom;

            Hashtable deviceInfo = new Hashtable();
            deviceInfo["FontEmbedding"] = "Subset";
            if (ExportType.ToLower() == "csv")
            {
                deviceInfo["NoHeader"] = true;
                deviceInfo["NoStaticText"] = true;
            }
            ExportType = ExportType == "rtf" ? "docx" : ExportType;
            Telerik.Reporting.Processing.ReportProcessor RP = new Telerik.Reporting.Processing.ReportProcessor();
            byte[] buffer = RP.RenderReport(ExportType.ToUpper(), report1, deviceInfo).DocumentBytes;

            string myPath = "C:";
            string file = myPath + @"\" + DateTime.Now.ToString("HHmmss") + "." + ExportType;
            FileStream fs = new FileStream(file, FileMode.Create);

            fs.Write(buffer, 0, buffer.Length);
            fs.Flush();
            fs.Close();

            Process.Start(file);
        }

        void table_ItemDataBinding(object sender, EventArgs e)
        {
            Telerik.Reporting.Processing.Table processingTable = (sender as Telerik.Reporting.Processing.Table);
            processingTable.DataSource = DataSource;
            int count = ColumnCollection.Where(p => p.ColIsVisible == true).Count();
            Telerik.Reporting.HtmlTextBox headerCol;
            Telerik.Reporting.TextBox textBox;

            int column = 0;
            foreach (GridViewData.columnData info in ColumnCollection)
            {
                if (info.ColIsVisible)
                {
                    TableGroup tableGroupColumn = new TableGroup();
                    table1.ColumnGroups.Add(tableGroupColumn);
                    table1.Body.Columns.Add(new Telerik.Reporting.TableBodyColumn(new Telerik.Reporting.Drawing.Unit(2D, Telerik.Reporting.Drawing.UnitType.Inch)));

                    string columnName = info.ColHeader;
                    headerCol = CreateTxtHeader(columnName, column);
                    headerCol.Style.BackgroundColor = Color.LemonChiffon;
                    headerCol.Style.BorderStyle.Default = BorderType.Solid;
                    headerCol.Style.BorderWidth.Default = Unit.Pixel(1);
                    headerCol.Size = new SizeU(Unit.Inch(3.5), Unit.Inch(0.3));
                    tableGroupColumn.ReportItem = headerCol;

                    textBox = CreateTxtDetail(info.ColDataMemberBinding, column);
                    textBox.Style.BorderStyle.Default = BorderType.Solid;
                    textBox.Style.BorderWidth.Default = Unit.Pixel(1);
                    textBox.CanGrow = true;
                    textBox.Size = new SizeU(Unit.Inch(1.1), Unit.Inch(0.3));
                    column++;
                    table1.Body.SetCellContent(0, column, textBox);
                    table1.Items.AddRange(new ReportItemBase[] { textBox, headerCol });

                }
            }

        }

        static void textBox_ItemDataBound(object sender, EventArgs e)
        {

            if (((Telerik.Reporting.Processing.TextBox)sender).Value == null || (((Telerik.Reporting.Processing.TextBox)sender).Value.ToString() == ""))
            {
                ((Telerik.Reporting.Processing.TextBox)sender).Value = "";
            }

        }

        public static Telerik.Reporting.HtmlTextBox CreateTxtHeader(string FieldName, int i)
        {

            Telerik.Reporting.HtmlTextBox txtHead = new Telerik.Reporting.HtmlTextBox();
            txtHead.Value = FieldName;
            return txtHead;
        }

        public static Telerik.Reporting.HtmlTextBox CreateHTMLTxtDetail(string FieldName, int i)
        {

            Telerik.Reporting.HtmlTextBox txtHead = new Telerik.Reporting.HtmlTextBox();
            txtHead.Value = "=[" + FieldName + "]";
            //txtHead.Dock = DockStyle.Left;
            //txtHead.Name = FieldName;
            txtHead.CanGrow = true;
            return txtHead;
        }

        public static Telerik.Reporting.TextBox CreateTxtDetail(string FieldName, int i)
        {

            Telerik.Reporting.TextBox txtHead = new Telerik.Reporting.TextBox();
            txtHead.Value = "=Fields." + FieldName + "";
            txtHead.Name = FieldName;
            txtHead.TextWrap = true;
       
            //txtHead.Dock = DockStyle.Left;
            //txtHead.CanGrow = true;
            return txtHead;
        }

    }

 

 

veena
Top achievements
Rank 1
 answered on 16 May 2011
6 answers
264 views
Is there a way to determine the required report viewer height where by there will be no vertical scrollbar. I wish to "grow" the report viewer container so the user will only need to use the browser scrollbar.

I could "guess" the height by the report pagesettings and zoom and but there must be a more elegant way.

Thanks
Mike
Top achievements
Rank 1
 answered on 16 May 2011
5 answers
182 views
Hello ,

We have a class library which contains all reports in the application.Also we have three different applications developed in Silverlight , WPF and Asp.Net website.Each report can be called used in all application.Now we want to localize all the reports based on the culture set from the application. I have gone through the link http://www.telerik.com/help/reporting/report-viewer-localization.html , but it did not help me.Also i could not found good reference material for localization.

It will be good if you can provide us the sample project which will work for all three kind of applications which includes setting a label text from resource file.

Thanks in advance.
Massimiliano Bassili
Top achievements
Rank 1
 answered on 16 May 2011
1 answer
170 views
I am trying to set a multivalue parameter of type Integer programatically with an array of int.
However, I get back an error of "Invalid value of parameter".

I have tried a number of combinations but keep encountering the error.

Where am I going wrong?
Stephan
Telerik team
 answered on 16 May 2011
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?