Telerik Forums
Reporting Forum
3 answers
441 views
Hi,

I need to know how can I prepare dynamic crosstab report. I used code from examples. But it's generate only header row and one data row.

private void crosstab1_ItemDataBinding(object sender, EventArgs e)
        {
           //Connections and commands
           .....
 
            //get the processing table object since we're in the context of event
            Telerik.Reporting.Processing.Table processingTable = (sender as Telerik.Reporting.Processing.Table);
            //construct the select statement based on the selected report parameters
            
            SqlDataAdapter sqlAdapter = new SqlDataAdapter(sComm);
            sqlAdapter.SelectCommand.CommandTimeout = 3600;
            //create a dataset, fill it and set it as datasource to the processing table object
            DataSet ds = new DataSet();
            sqlAdapter.Fill(ds);
            processingTable.DataSource = ds.Tables[0];
 
            //create two HtmlTextBox items (one for header and one for data) which would be added to the items collection of the table
            Telerik.Reporting.HtmlTextBox textboxGroup;
            Telerik.Reporting.HtmlTextBox textBoxTable;
 
            //we do not clear the Rows collection, since we have a details row group and need to create columns only
            this.crosstab1.ColumnGroups.Clear();
            this.crosstab1.Body.Columns.Clear();
            this.crosstab1.Body.Rows.Clear();
            int i = 0;
            this.crosstab1.ColumnHeadersPrintOnEveryPage = true;
            DataTable dt = ds.Tables[0];
 
            foreach (DataColumn dc in dt.Columns)
            {
                Telerik.Reporting.TableGroup tableGroupColumn = new Telerik.Reporting.TableGroup();
                this.crosstab1.ColumnGroups.Add(tableGroupColumn);
                this.crosstab1.Body.Columns.Add(new Telerik.Reporting.TableBodyColumn(Unit.Inch(1)));
 
                textboxGroup = new Telerik.Reporting.HtmlTextBox();
                textboxGroup.Style.BorderColor.Default = Color.Black;
                textboxGroup.Style.BorderStyle.Default = BorderType.Solid;
                textboxGroup.Value = dc.ColumnName;
                textboxGroup.Size = new SizeU(Unit.Inch(1.1), Unit.Inch(0.3));
                tableGroupColumn.ReportItem = textboxGroup;
 
                textBoxTable = new Telerik.Reporting.HtmlTextBox();
                textBoxTable.Style.BorderColor.Default = Color.Black;
                textBoxTable.Style.BorderStyle.Default = BorderType.Solid;
                textBoxTable.Value = "=Fields." + dc.ColumnName;
                textBoxTable.Size = new SizeU(Unit.Inch(1.1), Unit.Inch(0.3));
                this.crosstab1.Body.SetCellContent(0, i++, textBoxTable);
                this.crosstab1.Items.AddRange(new ReportItemBase[] { textBoxTable, textboxGroup });
            }
        }
Stef
Telerik team
 answered on 11 Jul 2013
3 answers
263 views
I cannot get a consistent rendering of the content within an HtmlTextBox from the WebReportViewer to Word and Excel exports

In HTML, the outer DIV height renders too short cropping the content.
In Word, one of the lines is not visible until you zoom in even though its the same as the next line
In Excel, the row is rendered to short and the bottom content is hidden.


Grabbing the rendered HTML from the WebForm ReportViewer it renders fine in Firefox, and Chrome but only appears to render correct in Internet Explorer when the Document Mode is set to Quirks or IE7, but this does not explain the Word and Excel issues.

The HtmlTextBox is set to 11pt because the Html Content is wrapped in a <font size=2> in order to target the desired height of 8pt.
Excel is rendering the content at 11pt as the HTML tags have been stripped, but the calculated size is not taken into account.

I assume that HTML do not like decimal font-sizes other then halves.  IE 6.7pt => 6.5pt

<div style='font-size:8pt; width:713px;'>
    <FONT size=2>
        <FONT size=1>
            I (We) certify that the information on this Balance Sheet is true and correct to the best of my (our) knowledge.  I (We) have provided this information to xxxxxxxxxxx  Bank to obtain or maintain a loan.  I (We) understand that false statements made may be subject to prosecution.  The xxxxxxxxxxx Bank is authorized to verify the statements contained herin and I (We) request and authorize all individuals or businesses to release information to xxxxxxxxxxx Bank regarding our business relationships.  I (We) agree to all these conditions and terms of this application.  <BR> <BR> <BR>Signature:________________________________________________________ Date: __________<BR> <BR> <BR> <BR>Signature: ________________________________________________________Date:__________
        </FONT>
    </FONT>
</div>
 
<br/>
<hr/>
<br/>
 
<style type="text/css">
div.htmlTextBox2 { line-height:110%; height:111px; top:535px; width:713px; font-family:Arial; font-size:11pt; margin:0; padding:0; }
div.htmlTextBox2 * { line-height:110%; }
.s67 { font-size: 9.79pt; padding: 0; }
.s68 { font-size: 6.6pt; padding:0; }
</style>
<div title="" class="htmlTextBox2 s64" style="overflow: visible; border:1px solid red;">
<DIV style="MARGIN-TOP: 0px" class=html-root>
    <DIV class=s66 style='margin:0;padding:0;'>
            <FONT class=s67>
                <FONT class=s68>
                    I (We) certify that the information on this Balance Sheet is true and correct to the best of my (our) knowledge.  I (We) have provided this information to xxxxxxxxxxx Bank to obtain or
                </FONT>
            </FONT>
            <FONT class=s67>
                <FONT class=s68>
                    maintain a loan.  I (We) understand that false statements made may be subject to prosecution.  The xxxxxxxxxxx Bank is authorized to verify the statements contained herin and I
                </FONT>
            </FONT>
            <FONT class=s67>
                <FONT class=s68>
                    (We) request and authorize all individuals or businesses to release information to xxxxxxxxxxx Bank regarding our business relationships.  I (We) agree to all these conditions and
                </FONT>
            </FONT>
            <FONT class=s67>
                <FONT class=s68>
                    terms of this application.  <BR>
                </FONT>
            </FONT>
            <FONT class=s67>
                <FONT class=s68>
                    <BR>
                </FONT>
            </FONT>
            <FONT class=s67>
                <FONT class=s68>
                     <BR>
                </FONT>
            </FONT>
            <FONT class=s67>
                <FONT class=s68>
                    Signature:________________________________________________________ Date: __________<BR>
                </FONT>
            </FONT>
            <FONT class=s67>
                <FONT class=s68>
                    <BR>
                </FONT>
            </FONT>
            <FONT class=s67>
                <FONT class=s68>
                     <BR>
                </FONT>
            </FONT>
            <FONT class=s67>
                <FONT class=s68>
                     <BR>
                </FONT>
            </FONT>
            <FONT class=s67>
                <FONT class=s68>
                    Signature: ________________________________________________________Date:__________
                </FONT>
            </FONT>
    </DIV>
</DIV>
</DIV>



Stef
Telerik team
 answered on 11 Jul 2013
1 answer
98 views
Hi.

Is it possible to know how much of page will be used before print it? (The data is dynamic)

The ideia is to know how much of page will be used to decide if I will print in only one page like below or two pages.

customer receipt
some data printed

-------------------------
company receipt
some data printed

If customer receipt pass the size that I tought then I will use two or more pages.

Best regards

Wilton Ruffato Wonrath
Ivan Hristov
Telerik team
 answered on 11 Jul 2013
4 answers
119 views
I installed the Telerik components (TelerikControlPanelSetup_2013_2_625.exe) that I need for the project I'm working on. However, I still get, "The type or namespace name 'Telerik' could not be found (are you missing a using directive or an assembly reference?)" when trying to compile. 

The red "Telerik" in the code does not have a "resolve" context menu item, as one would expect. I do have the following in my References for the project:

Telerik.Reporting
Telerik.Reporting.OpenXmlRendering
Telerik.Reporting.Service
Telerik.Reporting.XpsRendering
Telerik.ReportViewer.WebForms
Telerik.Web.Mvc

Perhaps the version numbers are mismatched? They are:

Runtime version: v2.0.50727
Version: 7.0.13.220

These may differ from what I downloaded (presumably the latest), but when I tried to download/install the older version (referenced in our internal install list, namely TelerikControlPanelSetup_2012_2_809.exe, the install process fails. Those woes are detailed here:

http://www.telerik.com/community/forums/reporting/telerik-reporting/unable-to-install-components.aspx

So, are the Telerik components not recognized because the ones in my References are the older versions, which I do not have installed? If so, why do they not sport a warning or error icon?
Peter
Telerik team
 answered on 11 Jul 2013
7 answers
189 views
This is probably not the best place for this, but I didn't see anything more appropriate. In order to get a project I'm working on compiling again (new machine, have to reinstall and reconfigure a gazillion things), I need to install Telerik components. However, when I try to do so, it tells me it must first download an updated installer. I agree, and it runs for awhile and then crashes, telling me:


Telerik.CommonInstaller.ControlPanel has stopped working

A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available.


So what can I do to install?
Stef
Telerik team
 answered on 11 Jul 2013
3 answers
137 views
Software:
Microsoft Visual Studio 2010 Professional (Ver 4.0.30319 SP1)
Telerik Reporting (6.1.12.611)
Telerik Report Viewer (6.1.12.611)
Windows 7 Professional 64-Bit (SP1)

Problem:
Opening a designer file for a Telerik Report causes an error to occur (Screenshot attached). 

Actions Taken:
I've attempted to upgrade Telerik using the "Upgrade Wizard". Once it sees all of the reports it gives me the option to upgrade to version "6.0.12.215". 

Limitations:
In one of my reports, I use the Telerik.Reporting.InstanceReportSource class. This class was implemented after the 6.0.12.215 class from what I've read and I therefore cannot roll-back the release of Telerik that I use. It is preferred that I do not change the release of Telerik that I use at all.

Additional Information:
One of my co-workers can open the report files just fine using the same .dll references that I use since they are checked into Subversion. He can also see the reports locally when running the web application. I can not see the reports on my local copy of the application, instead I get a 503 (Service is unavailable) error. Neither of us have un-committed local changes. Our code base should be the same. 

I hope I've covered everything. I hope to hear back soon, thanks!
Stef
Telerik team
 answered on 11 Jul 2013
8 answers
368 views
Hi

I have this error on a Report with a PictureBox and large images (> 2MB) :

An error has occurred while processing PictureBox 'Foto1': Unable to create the store directory. (Exception from HRESULT: 0x80131468) 

The error appears only on the hosted site and not on my PC.

Target Framework: 3.5
Reporting version: Q3 2012 -  6.2.13.110

Attached the screenshot of the error.

Thanks in advance
Simone
Chavdar
Telerik team
 answered on 11 Jul 2013
7 answers
218 views
I made this a simple as possible.
I though maybe it had to do with master page nesting and displaying in a popup window. So I created just a basic webpage and I can print it just fine but nothing displays in the ReportViewer other than page 1 of 18. It does not display when running in VS2012 or when deployed to the website.
It used to display before I upgraded Telerik Reporting. It will display fine in Chrome.
This problem presents itself on all machines that try to use the webpage on our intranet.
I have tried everything that I have seen in the forum, but have had no luck.

 

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Billing.aspx.cs" Inherits="Wysocki.Farm.Intranet.Billing.Billing" %>
 
<%@ Register Assembly="Telerik.ReportViewer.WebForms, Version=7.0.13.426, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" Namespace="Telerik.ReportViewer.WebForms" TagPrefix="telerik" %>
 
<!DOCTYPE html>
 
<head runat="server">
    <title></title>
         <style type="text/css">           
        html#html, body#body, form#form1, div#content
        {  
            height: 100%;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <div id="content">
        <telerik:ReportViewer ID="ReportViewer1" runat="server" Height="100%" Width="100%" ViewMode="PrintPreview" ></telerik:ReportViewer>  
    </div>
    </div>
    </form>
</body>
</html>

 

 
I also tried:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Billing.aspx.cs" Inherits="Wysocki.Farm.Intranet.Billing.Billing" %>
 
<%@ Register Assembly="Telerik.ReportViewer.WebForms, Version=7.0.13.426, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" Namespace="Telerik.ReportViewer.WebForms" TagPrefix="telerik" %>
 
<!DOCTYPE html>
 
 
<head runat="server">
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta content="text/html; charset=UTF-8" http-equiv="content-type">
    <title></title>
         <style type="text/css">           
        html#html, body#body, form#form1, div#content
        {  
            height: 100%;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <div id="content">
        <telerik:ReportViewer ID="ReportViewer1" runat="server" Height="100%" Width="100%" ViewMode="PrintPreview" ></telerik:ReportViewer>  
    </div>
    </div>
    </form>
</body>
</html>
Stef
Telerik team
 answered on 11 Jul 2013
4 answers
130 views
I have report with enabled localization for English (default) and German. When I change some inner text labels (such as "chart1.PlotArea.EmptySeriesMessage.TextBlock.Text", "chart1.PlotArea.YAxis.AxisLabel.TextBlock.Text" etc) they change in Report.resx and Report.de.resx simultaneously. Why? How can I specify different texts for different languages?
Stef
Telerik team
 answered on 10 Jul 2013
2 answers
153 views
hi:
How to change the default tips like 'Done!Click 'Save' to download the file' in sliverlight application?
Squall
Top achievements
Rank 1
 answered on 10 Jul 2013
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?