Telerik Forums
Reporting Forum
1 answer
216 views
Hi,
I need to change the image when exporting to pdf because I want the image to be 300 dpi when printing and 72 when viewing on the webpage.
I have tried this with no success:
private void pictureBox1_ItemDataBound(object sender, EventArgs e) 
        { 
            HttpContext context = System.Web.HttpContext.Current; 
            System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Profit)); 
            if (context != null
                pictureBox1.Value = ((object)resources.GetObject("logo72dpi")); 
            else 
                pictureBox1.Value = ((object)resources.GetObject("logo300dpi")); 
        } 
The report is called Profit and the images is in projects resource file.
Can you help me?

/Mattias
Steve
Telerik team
 answered on 02 Apr 2009
1 answer
87 views
Hi,

I have a report that prints payment information of employees in a Department. All items are fetched in a DataTable and the is set as the DataSource of the report. So far, everything works OK.

But in the PageHeader section there are a few fields I would like to print according to the selection made. Like Department name, Selectino year and Selection Month. The thing is that I am not allowed to interfere with the DataTable to add relvant columns to call althese necessary information databound and relate it to the TextBox with "Fields.DepartmentName".

So I choose to use this code:
txtDepartmentName.Value = GetDepartmentName(this.DeptID); 
in the various method such as:
private void MyReport_NeedDataSource(object sender, System.EventArgs e) 
 
private void MyReport_ItemDataBound(object sender, System.EventArgs e) 
 
private void pageHeader_ItemDataBound(object sender, System.EventArgs e) 

but unfortunately, none of them worked. What am I doing wrong? Where should I make these assignments. Which method duits this situation fine?

Regards...
Steve
Telerik team
 answered on 01 Apr 2009
1 answer
259 views
Hi Guys, we working on some reports, going over them again, reading what would be better.

We started creating reports using the wizard, so we had designtime support. Great, that works. But now I want to add some more flexibilitty to the code. So I added a NeedDataSource event to the report including the next code:

 this.generalReportDataSetTableAdapter1.Connection.ConnectionString = ConfigurationManager.ConnectionStrings["Report.ConnectionString"].ConnectionString; 
            this.generalReportDataSetTableAdapter1.FillByClientIdAndBetweenStartAndEndDate(this.generalReportDataSet.GeneralReportDataSetTable, 
                Convert.ToInt32(this.ReportParameters["pClientId"].Value), Convert.ToDateTime(this.ReportParameters["pStartDate"].Value), Convert.ToDateTime(this.ReportParameters["pEndDate"].Value)); 
 
            Processing.Report report = (Processing.Report)sender; 
            Report.DataSource = this.generalReportDataSet; 

of course in de constructor I set: this.DataSource = null;

Nou when I set breakpoints, I can see my DS is filled. No problem but all my textboxen throw: the expression contains object 'Name' that is not defined in the current context. Where name is different for every textbox.

The structure of the DS is still the same.

It seems I cannot get the fields in the DB anymore

How is that possible.




Stephan
Top achievements
Rank 1
 answered on 01 Apr 2009
1 answer
196 views
I created an elaborate report using a SQL view as a data source. I updated the view in SQL and tried unsuccessfully

1. To get the new fields include in the report by redoing the datasource in VS. (When I updated the data source and tried to run the report I get red boxes saying that I have null values. However, running the datasource and viewing the returned records shows that those fields are not null.)

2. Create a new report with the new data set. Then replacing the dataset in the first report with this new data set and tableAdapter. When I try this I get red boxes with "object not set ot an instance of an object." Additionally, when I try to edit my expressions I get no Fields listings at all. Is seems from this that the old report has not recognized the data returned in the new data source.

I suspect that there is very simple answer. But how do I up date the data the report is looking at when I update the view in SQL server?

Thanks,

Matthew
Steve
Telerik team
 answered on 01 Apr 2009
1 answer
77 views
hi  i am pramod
i using telerik reporting very heavily i have one issue regarding text formating
i embedded html table in one string and and take on textbox on report and give string value to textbox
my string TodisplayList

            ToDisplayList = @"<table cellpadding='0' cellspacing='0' border='1' width='570'>";
            ToDisplayList += @"<tr  bgColor='#cbccd1'><td align='center'> <b>" + "Services" + "</b></td align='center'>" + "<td><b>" +                 "Duration" + "</b></td> " + "<td><b>" + "Appointments" + "</b></td>" + "<td><b>" + "Average" + "</b></td></tr>";
            while (_enumerator1.MoveNext() && _enumerator2.MoveNext())
            {
                if (Convert.ToInt32(_enumerator1.Value) > 0 && Convert.ToInt32(_enumerator2.Value) > 0)
                {
                    ToDisplayList += @"<tr><td>" + _enumerator1.Key + ":</td>" + "<td align='center'>" + _enumerator1.Value + " </td>" +                     "<td align='center'>" + _enumerator2.Value + " </td>" + "<td align='center'>" + float.Parse(_enumerator1.Value.ToString()) /                 float.Parse(_enumerator2.Value.ToString()) + " </td> </tr> ";
                }
                else
                {
                    ToDisplayList += @"<tr><td>" + _enumerator1.Key + ":</td>" + "<td align='center'>" + _enumerator1.Value + " </td>" + "<td align='center'>" + _enumerator2.Value + " </td>" + "<td align='center'>" + (Convert.ToInt32(_enumerator1.Value) / Convert.ToInt32(_enumerator2.Value)) + " </td> </tr> ";
                }

                ServiceCount++;
                DurationCount += Convert.ToInt32(_enumerator1.Value);
            }
            ToDisplayList += @"<tr height='10'><td colspan='4'></td></tr> ";
            ToDisplayList += @"</table>";


--------------------------------------
now i bind that string to
this.textBox12.Value = ToDisplayList;

its display fine but when i taken print it also print the embeded html script 
please give me any solution on this..?




Steve
Telerik team
 answered on 01 Apr 2009
0 answers
97 views
Hi support,
I am new to telerik reporting.
Could you tell me, How to use Dynamic data for charts. i.e using a data source,data set and query.
Could you also tell me, info regarding how to use all tools in telerik



Thanks and Regards
Praveen
Praveen kumar
Top achievements
Rank 1
 asked on 01 Apr 2009
1 answer
136 views
I am testing out Telerik Reporting and will probably ditch Crystal reports soon because of the troubles i've been having with it.

Problem though is, i try to align the textboxes together in an attempt to output the address of a client but when i preview it... there is an inconsitent space between the address and the city... i can't figure out why yet.

http://s734.photobucket.com/albums/ww342/crazycoders/?action=view&current=ReportDesigner.gif
http://s734.photobucket.com/albums/ww342/crazycoders/?action=view&current=ReportPreview.gif

Thanks


Milen | Product Manager @DX
Telerik team
 answered on 01 Apr 2009
1 answer
171 views
hI,

is there a way to separate the location of all the report templates from the application path?another thing, is it possible that if i modify an existing report or even if i make another report i dont need to recompile the whole application, i'll just difine the report template name on my DB and it will be available on my application or something like that?  
Thanks


Dennis
Steve
Telerik team
 answered on 31 Mar 2009
3 answers
259 views
Dear ....
please can anyone help  me ,
I have report with four parameters (StartDate , EndDate , Count of records , Country )

when I pressed in these parameters , I got The chart
this is my code 

 

 

private

 

void chart1_NeedDataSource(object sender, EventArgs e)

 

{

Telerik.Reporting.Processing.

Chart chart = sender as Telerik.Reporting.Processing.Chart;

 

 

SqlConnection conn = new SqlConnection("Server=(local);Database=UMG;Integrated Security=SSPI;");

 

 

SqlCommand command = new SqlCommand("GetDiagnosisReport", conn);

 

command.CommandType =

CommandType.StoredProcedure;

 

command.Parameters.AddWithValue(

"@Country", this.ReportParameters["Country"].Value);

 

command.Parameters.AddWithValue(

"@FromDate", this.ReportParameters["FromDate"].Value);

 

command.Parameters.AddWithValue(

"@ToDate", this.ReportParameters["ToDate"].Value);

 

command.Parameters.AddWithValue(

"@Count", this.ReportParameters["Count"].Value);

 

 

SqlDataAdapter adapter = new SqlDataAdapter(command);

 

 

DataSet ds = new DataSet();

 

 

try

 

 

 

 

 

{

adapter.Fill(ds);

}

 

catch (Exception ex)

 

{

System.Diagnostics.

Debug.WriteLine(ex.Message);

 

}

 

DataView view = ds.Tables[0].DefaultView;

 

chart.DataSource = view;

 

}

 

but when I got chart without bound any value (there is no ,or empty series)


then I put parameters and press for preview I got this error 

An error has occured while processing Chart 'chart1':
An Unexpected error has occurred. Please review the InnerException for more information how to resolve the problem.


its urgent

thanks in advance

 

Steve
Telerik team
 answered on 30 Mar 2009
1 answer
479 views
I have a sub report where I have a total setup to print in the footer of the sub report.
It is setup to be visible, print on lost page.

Whe I do a preview of the subreport it is there just fine.

When I run the master report for that sub report it does not show up.

An ideas?

thx

Jim
Steve
Telerik team
 answered on 30 Mar 2009
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?