I'm trying to make a textbox in the footer the difference of two textbox value.
One is a sum value of a data item, the other is a value generated via codebehind.
I've tried this:
Private
Sub
ReportFooterSection1_ItemDataBound(sender
As
Object
, e
As
EventArgs)
Handles
ReportFooterSection1.ItemDataBound
oConn.Open()
Dim
ocmd
As
New
SqlCommand(
"SELECT * FROM tblDynamic"
, oConn)
ocmd.CommandType = SqlDataSourceCommandType.Text
Dim
reader
As
SqlDataReader
reader = ocmd.ExecuteReader
If
reader.HasRows
Then
reader.Read()
_txtLoansPerFinancial.Value = reader(
"TotalLoansPerFinancials"
).ToString()
_txtLoanDifference.Value = _txtLoansPerFinancial.Value - _txtTotalLoanBalance.Value
End
If
oConn.Close()
End
Sub
Where the expression on _txtTotalLoanBalance is = Sum(Fields.PctRiskTierGT1) , however rather than get the value that the expression brings, it incorporates _txtTotalLoanBalance.value as the string "= Sum(Fields.PctRiskTierGT1)" and it gets an error.
How can I get the value of this text box, or the value of Sum(Fields.PctRiskTierGT1) in the codebehind?
Hello all reporting gurus.
I've been using Telerik reporting in Silverlight for 5 years, acctually with no serious issue.
Now we need to send a report via Mail w/o passing thru printing it to pdf and manually attaching it to a mail. So I've googled a little and found a way thru RepoerRender. The problem is that I'm NOT able to pass any parameter (all I get is a page with just fixed fields and DataSource is not used anytime (I have a breakpoint in report's rptPraticaPreventivo_NeedDataSource event, and it's never hit), so I guess I'm doing it the wrong way.
Can you pls help me in passing parameters the right way?
code I'm using is right after (both in VB and C#). Thank you in advance!
======================================VisualBasic=======================================================
Public Sub SendByMail(nomeRpt As String, parList As String, codTesti As String, adresses As String, sender As String, subj As String, body As String, mailPwd As String)
Dim rptSrc As New InstanceReportSource()
Dim exRpt = Assembly.GetExecutingAssembly
Dim tcw As Type = Type.GetType("UGO_Rpt." + nomeRpt)
Dim rp As New rptPraticaPreventivo
Dim pars() As String = parList.Split(";")
For Each par In pars
Dim idVal() = par.Split("=")
Dim id As String = idVal(0)
Dim val As String = idVal(1)
rptSrc.Parameters.Add(id, val)
Next
rptSrc.ReportDocument = rp
Dim rpt = TryCast(rp, Telerik.Reporting.Report)
Dim reportProcessor As New ReportProcessor()
Dim result As RenderingResult = reportProcessor.RenderReport("PDF", rpt, Nothing)
Dim ms As New MemoryStream(result.DocumentBytes)
ms.Position = 0
Dim attachment As New Attachment(ms, rpt.Name + ".pdf")
Dim msg As New MailMessage(sender, adresses, subj, body)
msg.ReplyToList.Add(sender)
msg.Attachments.Add(attachment)
Dim SmtpServer As New System.Net.Mail.SmtpClient()
Dim netCred As New NetworkCredential
netCred.UserName = "security@mydomain.com"
netCred.Password = mailPwd
SmtpServer.Credentials = netCred
SmtpServer.Port = 587 'Porta standard SMTP/TSL
SmtpServer.Host = "name.server.com"
SmtpServer.SendMailAsync(msg)
End Sub
========================================C#===========================================================
public void SendByMail(string nomeRpt, string parList, string codTesti, string adresses, string sender, string subj, string body, string mailPwd)
{
InstanceReportSource rptSrc = new InstanceReportSource();
dynamic exRpt = Assembly.GetExecutingAssembly;
Type tcw = Type.GetType("UGO_Rpt." + nomeRpt);
rptPraticaPreventivo rp = new rptPraticaPreventivo();
string[] pars = parList.Split(";");
foreach (void par_loopVariable in pars) {
par = par_loopVariable;
[] idVal = par.Split("=");
string id = idVal(0);
string val = idVal(1);
rptSrc.Parameters.Add(id, val);
}
rptSrc.ReportDocument = rp;
dynamic rpt = rp as Telerik.Reporting.Report;
ReportProcessor reportProcessor = new ReportProcessor();
RenderingResult result = reportProcessor.RenderReport("PDF", rpt, null);
MemoryStream ms = new MemoryStream(result.DocumentBytes);
ms.Position = 0;
Attachment attachment = new Attachment(ms, rpt.Name + ".pdf");
MailMessage msg = new MailMessage(sender, adresses, subj, body);
msg.ReplyToList.Add(sender);
msg.Attachments.Add(attachment);
System.Net.Mail.SmtpClient SmtpServer = new System.Net.Mail.SmtpClient();
NetworkCredential netCred = new NetworkCredential();
netCred.UserName = "security@mydomain.com";
netCred.Password = mailPwd;
SmtpServer.Credentials = netCred;
SmtpServer.Port = 587;
//Porta standard SMTP/TSL
SmtpServer.Host = "name.server.com";
SmtpServer.SendMailAsync(msg);
}
As described in this forum question, I have created a dynamically-sizable page footer by creating an unbound group and enabling PrintAtBottom and PrintOnEveryPage. The problem I am having now, however, is that the resizing isn't playing nicely with the text of the report in the Detail section, and on one page is hiding half a line of text with the whitespace at the top of the footer (defined as padding above the horizontal line, but removing the padding and moving the horizontal line down in the footer section creates the same effect); see attachment.
I have created the footer as belonging to an unbound group instead of creating a PageFooter section in order to enable text in the footer to wrap as necessary without requiring the footer to be enormous all the time.
I have a printer named XER. How can I print directly to a printer? I'm sharing my code here.
I want to print directly from my printer named XER without previewing..
thank you for your help?
private void reportViewer1_Load(object sender, EventArgs e)
{
try
{
var mfrm = (Frm_Giris) Application.OpenForms["Frm_Giris"];
if (mfrm != null)
{
mfrm.datacenter();
var rap = new Prt_AYazdir();
rap.a.Value = alma.ToString();
rap.b.Value = bal.ToString();
rap.c.Value = tarih.ToString();
rap.borc.Value = borc.ToString();
rap.sqlDataSource1.ConnectionString = mfrm.serveryolu;
var ss = "a";
ss = "select * from xxxx where id='" + aid + "' order by id asc; ";
rap.sqlDataSource1.SelectCommand = ss;
var reportSourcea = new Telerik.Reporting.InstanceReportSource();
reportSourcea.ReportDocument = rap;
reportViewer1.ReportSource = reportSourcea;
reportViewer1.RefreshReport();
}
}
I'm using Telerik Reporting for an MVC app and I have a requirement to print payroll checks. I don't need to recreate the entire check, I just need to fill in data in the check for date, amount, etc., in the appropriate areas on the check.
The payroll checks are on 8.5 x 11 sheets with three checks per sheet, vertically (top to bottom). Therefore, I need to be able to create a report that allows me to basically limit each page to three rows of data, each row representing an individual check. How do I go about doing this? I tried putting a particular field in the detail section three times, but, of course, it just prints the contents of the field three times. It's almost as if I need three detail sections per page (one detail section per check), but I don't see that Telerik Reporting supports that.
Hi,
How can I create a table report with 100 fields across that does not necessary fit into the report?
I do not care to print such a report, except only to save as an excel doc after it renders.
Currently I have memory exception when i run the report.
Can someone help me please?
Thanks,
Ali.
Hi,
I've just create an ASP.NET MVC application with report viewer for ASP.NET MVC.
Everything is working fine but the only issue is currently that if I open the web page from a tablet I can't scroll the report up and down by swiping with the finger.
I've seen that within the div where the report is displayed and so where the scrollbars come up there is the style "touch-action: none" hardcoded: by using the debug tools i've changed the value of the property to "auto" and the swipe with the finger then works.
How I can do it with a javascript function? I tried by catching the RenderingEnd event and by "jquery $(".trv-page-wrapper").css("touch-action", "auto");" without success...
Please help me...
Thx.
Luca