Telerik Forums
Reporting Forum
5 answers
94 views

I have several reports that are built dynamically that stopped working after we upgraded to the Q3 2009 release, using version 3.2.9.1211. I tried setting the ReportViewer's EnableViewState property to false and that had no impact on the problem. When the report is generated a 1-page blank report appears.

 

I took one of the Telerik sample provided on this forum and put it in a small, much simpler project. I receive the exact sample behavior. Here is the code that I am using:

 

using

 

System;

 

 

 

using

 

System.Web;

 

 

 

using

 

System.Web.UI;

 

 

 

using

 

System.Web.UI.WebControls;

 

 

 

using

 

System.Data;

 

 

 

using

 

System.Configuration;

 

 

 

using

 

System.Web.Security;

 

 

 

using

 

System.Web.UI.WebControls.WebParts;

 

 

 

using

 

System.Web.UI.HtmlControls;

 

 

 

using

 

Telerik.Web.UI;

 

 

 

using

 

Telerik.Reporting;

 

 

 

using

 

Telerik.Reporting.Drawing;

 

 

 

public

 

partial class Default : System.Web.UI.Page

 

{

 

protected void Page_Load(object sender, EventArgs e)

 

{

Telerik.Reporting.

Report rpt = new Telerik.Reporting.Report();

 

 

DataSet ds = new DataSet();

 

ds.Tables.Add();

 

DataTable table = ds.Tables[0];

 

 

int columnCount = 3;

 

 

int rowCount = 1000;

 

 

//Add columns

 

 

 

 

 

for (int column = 0; column <= columnCount - 1; column++)

 

{

table.Columns.Add(

"Column" + (column + 1).ToString(), typeof(string));

 

}

 

//Add rows

 

 

 

 

 

for (int row = 0; row <= (rowCount - 1); row++)

 

{

 

string[] rowVals = (string[])Array.CreateInstance(typeof(string), columnCount);

 

 

DataRowCollection rowCollection = table.Rows;

 

 

for (int column = 0; column <= columnCount - 1; column++)

 

{

rowVals[column] =

"value_" + (column + 1).ToString() + "_" + (row + 1).ToString();

 

}

table.Rows.Add(rowVals);

}

rptViewer.Report = GenerateReportDefinition(

ref ds);

 

rptViewer.RefreshReport();

}

 

private Telerik.Reporting.TextBox CreateTxtHeader(string FieldName, int i)

 

{

Telerik.Reporting.

TextBox txtHead = new Telerik.Reporting.TextBox();

 

txtHead.Value = FieldName;

 

return txtHead;

 

}

 

private Telerik.Reporting.TextBox CreateTxtDetail(string FieldName, int i)

 

{

Telerik.Reporting.

TextBox txtHead = new Telerik.Reporting.TextBox();

 

txtHead.Value =

"=[" + FieldName + "]";

 

 

return txtHead;

 

}

Telerik.Reporting.

Report GenerateReportDefinition(ref System.Data.DataSet dataSource)

 

{

Telerik.Reporting.

Report report1 = new Telerik.Reporting.Report();

 

report1.DataSource = dataSource;

 

int count = dataSource.Tables[0].Columns.Count - 1;

 

Telerik.Reporting.Drawing.

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

 

Telerik.Reporting.Drawing.

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

 

 

SizeU size = new SizeU(Telerik.Reporting.Drawing.Unit.Cm(2), Telerik.Reporting.Drawing.Unit.Inch(0.3));

 

Telerik.Reporting.

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

 

Telerik.Reporting.

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

 

 

for (int column = 0; column < count; column++)

 

{

 

string columnName = dataSource.Tables[0].Columns[column].ColumnName;

 

Telerik.Reporting.

TextBox header = this.CreateTxtHeader(columnName, column);

 

header.Location =

new Telerik.Reporting.Drawing.PointU(x, y);

 

header.Size = size;

headColumnList[column] = header;

Telerik.Reporting.

TextBox textBox = this.CreateTxtDetail(columnName, column);

 

textBox.Location =

new Telerik.Reporting.Drawing.PointU(x, y);

 

textBox.Size = size;

detailColumnList[column] = textBox;

x += Telerik.Reporting.Drawing.

Unit.Inch(1);

 

}

Telerik.Reporting.

ReportHeaderSection reportHeaderSection1 = new Telerik.Reporting.ReportHeaderSection();

 

reportHeaderSection1.Height =

new Telerik.Reporting.Drawing.Unit(0.3, Telerik.Reporting.Drawing.UnitType.Inch);

 

 

//reportHeaderSection1.Style.BackgroundColor = Color.LightGray;

 

 

 

 

reportHeaderSection1.Items.AddRange(headColumnList);

Telerik.Reporting.

DetailSection detailSection1 = new Telerik.Reporting.DetailSection();

 

detailSection1.Height =

new Telerik.Reporting.Drawing.Unit(0.3, Telerik.Reporting.Drawing.UnitType.Inch);

 

detailSection1.Items.AddRange(detailColumnList);

report1.Items.Add(reportHeaderSection1);

report1.Items.Add(detailSection1);

 

return report1;

 

}

}

Valerie
Top achievements
Rank 1
 answered on 26 May 2010
2 answers
257 views
I have a project with Silverlight Reporting that works fine in dev. environment.
But in production i have this error on ReportViewer: 'An exception ocurred during the operation, making the result invalid. Check InnerException for exception details'.
My server is a virtual server.
I try to access the ReportService.svc, but have the  following error:
The type 'Telerik.Reporting.Service.ReportService, Telerik.Reporting.Service, Version=4.0.10.423, Culture=neutral, PublicKeyToken=a9d7983dfcc261be', provided as the Service attribute value in the ServiceHost directive could not be found
I´m not sure if is correct this response from ReportService.svc, in dev. enviroment the service is found fine.

I´m using Telerik Reporting Q1 2010, VS 2010 RTM,

I need to change something in configuration of server?

Thanks in advance.
Onaji Fernanda
Top achievements
Rank 1
 answered on 25 May 2010
1 answer
2.3K+ views
Hi there,

I am trying Telerik Reports, I need to include multiple detail sections in my reports, I have searched for this in forum and documentation, but i was unable to find this. I just wanted to know Is this feature available in telerik, If yes, can you suggest me how to do this?


Thanx.
Peter
Telerik team
 answered on 25 May 2010
4 answers
124 views
Hi
 I need to build a report comprising several diferent pages but all based on the same underlying data. For example the first page would be a summary of all data, the next few pages would be detailed information thqt was used to create the summary, then some text pages displaying written text ect.

I was going down the route of creating a separate report for each and using the ReportBook to bring them all together.

I'm thinking I could also do this with sub reports for each of the sections, which would be the prefered approach.

Andy
Peter
Telerik team
 answered on 25 May 2010
3 answers
222 views
what is the best way to troubleshoot when your datasource isn't working?

The Fields in the datasource just don't show up when trying to access them.   I need to pull data from an Entity Framework data source.
In the code below, I put everything into a simple class, like your Cars example.

I have created an ObjectDataSource which uses the call to Submissions.GetSubmissions().   I have assigned this datasource to the Report and an embedded list   Everything compiles without errors, but when I try to set a textbox to a field value, I don't see any fields, I just see, "No datasource".

I am using the newly released 2010 version of Telerik Reporting in Visual Studio 2008.

Suggestions?
Is there a walk through that I should be using?

Thanks,
   - Daniel

using System;  
using System.Collections;  
using System.Collections.Generic;  
using System.Configuration;  
using System.Linq;  
using System.Text;  
using DatabaseLayer;  
using log4net;  
 
namespace PCIIReports  
{  
    public class RSubmission  
    {  
        private Guid _submissionID;  
        private string _cikrName;  
        private string _cikrCountry;  
        private string _cikrState;  
 
        public RSubmission() { }  
 
        public RSubmission(Guid submissionId, String cikrName, string cikrCountry, string cikrState)  
        {  
            _submissionID = submissionId;  
            _cikrName = cikrName;  
            _cikrCountry = cikrCountry;  
            _cikrState = cikrState;  
        }  
 
        public Guid SubmissionId  
        {  
            get { return _submissionID; }  
            set { _submissionID = value; }  
        }  
 
        public String CIKRName  
        {  
            get { return _cikrName; }  
            set { _cikrName = value; }  
        }  
 
        public String CIKRCountry  
        {  
            get { return _cikrCountry; }  
            set { _cikrCountry = value; }  
        }  
 
        public String CIKRState  
        {  
            get { return _cikrState; }  
            set { _cikrState = value; }  
        }  
    }  
 
    public class Submissions  
    {  
        private static readonly ILog Log =  
            LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);  
 
        static string GetConnectionStringByName(string name)  
        {  
            // Assume failure.  
            string returnValue = null;  
 
            // Look for the name in the connectionStrings section.  
            ConnectionStringSettings settings =  
                ConfigurationManager.ConnectionStrings[name];  
 
            // If found, return the connection string.  
            if (settings != null)  
                returnValue = settings.ConnectionString;  
 
            return returnValue;  
        }  
 
        public Submissions()  
        {  
        }  
 
        public List<RSubmission> GetSubmissions()  
        {  
            var connectionString = GetConnectionStringByName("pciidbContext");  
 
            var context = new pciidbContext(connectionString);  
 
            var query =  
                from submission in 
                    context.Submissions.Include("Submitter").Include("OnBehalfOf").Include("Documents").ToList()  
                select new RSubmission  
                           {  
                               SubmissionId = submission.SubmissionId,  
                               CIKRName = submission.CriticalInfrastructureKey == null ? "Unknown" : submission.CriticalInfrastructureKey.Name,  
                               CIKRCountry = submission.CIKRCountry,  
                               CIKRState = submission.CIKRStateAbbr  
                           };  
            return query.ToList();  
        }  
    }  
}  
 
Adrian Segovia
Top achievements
Rank 1
 answered on 24 May 2010
1 answer
118 views

I have a report with 2 parameters.

I am using a RepotViewer object on my page.

I set the DataSource in the NeedDataSource Event, when I refresh the report in IE8 or Opera 10.53 the report does not refresh properly.

I have to click two time to see the data in the page.

best wishes

Steve
Telerik team
 answered on 24 May 2010
2 answers
126 views

Hello:

In a new application using Telerik reporting Q1 2010 v4.0.10.423, when I click on the export icon, the system shows a message box with the error “(XamlParseException) [Line: 0 Position: 0]”, followed by several “HRESULT E_FAIL” exceptions. In the same way, if I click on the print button, nothing happens.

I try it with an empty report (only with a static textbox), and the result is the same.

It happens on different computers.

I have another working project, that is using the same reporting version, and it works!

I run the Telerik upgrade wizard several times, and in different computers, but didn’t work.

 

Regards

Juan Segura

Juan Segura
Top achievements
Rank 1
 answered on 24 May 2010
1 answer
460 views


Hi ,

         Do you know , How to convert Amount to in words in telerik reporting tool ,

         eg: 1000 => One Thousand.


Thanks & Regards
Praveen
Steve
Telerik team
 answered on 24 May 2010
1 answer
220 views


Hi ,


        How  to convert Amount to Words in telerik reporting tool

       eg:  1000 => one thousand


Regards
    Praveen
Steve
Telerik team
 answered on 24 May 2010
0 answers
97 views
hi,
 i have  created report without using report wizard... here my coding is

 

private void ShiftReport_NeedDataSource(object sender, EventArgs e)

 

{

 

this.DataSource = null;

 

 

this.shifttab.DataSource = null;

 

 

DateTime StartDate = Convert.ToDateTime(this.ReportParameters["StartDate"].Value);

 

 

DateTime EndDate = Convert.ToDateTime(this.ReportParameters["EndDate"].Value);

 

 

string UserName = Convert.ToString(this.ReportParameters["UserName"].Value);

 

 

OleDbConnection con = new OleDbConnection(System.Configuration.ConfigurationManager.ConnectionStrings["FMS_1_0_0"].ToString());

 

 

OleDbCommand sqlCmd = new OleDbCommand("Shift_Report");

 

 

DataSet dsGetSearchResults = new DataSet();

 

sqlCmd.Connection = con;

sqlCmd.CommandType =

CommandType.StoredProcedure;

 

sqlCmd.Parameters.Add(

"Start_date", OleDbType.Date).Value = StartDate;

 

sqlCmd.Parameters.Add(

"End_date", OleDbType.Date).Value = EndDate;

 

sqlCmd.Parameters.Add(

"UserName", OleDbType.VarChar).Value = UserName;

 

con.Open();

 

OleDbDataAdapter Sqlda = new OleDbDataAdapter(sqlCmd);

 

 

try

 

{

 

Sqlda.Fill(dsGetSearchResults);

 

this.shifttab.DataSource = dsGetSearchResults;

 

 

this.DataMember = "";

 

 

}

 

catch (Exception ex)

 

{

}

}
and
/*the stored procedure is*/

create or replace PROCEDURE Shift_Report
(
       Start_date IN  DATE default null,
       End_date IN DATE default null,
       UserName IN Varchar default null,
       cv_1 IN OUT SYS_REFCURSOR
)
as 
tmp_userid number(10,0);
BEGIN
tmp_userid:=0;

 BEGIN
 select user_id into tmp_userid from ztuiusers where legacy_user_name = UserName ;
  EXCEPTION
  WHEN OTHERS THEN
         NULL;
       
  END;
OPEN cv_1 FOR
select  distinct
   CASE
      WHEN to_char(dol.datecreated,'HH24:MI:SS') BETWEEN '08:00:01' AND '16:45:00' THEN '08:00 - 04:45'
      WHEN to_char(dol.datecreated,'HH24:MI:SS') BETWEEN '16:45:01' AND '23:59:59' THEN '04:45 - 12:00'
      WHEN to_char(dol.datecreated,'HH24:MI:SS') BETWEEN '00:00:00' AND '08:00:00' THEN '12:00 - 08:00'
      END AS ShiftTime,
     -- to_char(dol.datecreated,'HH24:MI:SS') datecreated,
       f.fax_id,
       dol.title,
       Users.legacy_user_name
   from fax f
  JOIN data_object_log dol
          ON dol.entity_id = f.fax_id
 JOIN ztuiusers Users
         ON Users.user_id = f.user_id
 JOIN data_object_log_types dolt
        ON dolt.data_object_id = dol.data_object_id
 JOIN data_objects do
        ON do.data_object_id = dol.data_object_id
WHERE
(( UserName is null) or( Users.user_id = tmp_userid))and (f.received_date_time between Start_date and End_date)
order by ShiftTime ;
 END;


i want to group  the time column (i.e giving in case condition)
plz help me.. and post  the results as soon as possible...
thank u,
ramya
ramya kannan
Top achievements
Rank 1
 asked on 24 May 2010
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
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?