How to control report direction at runtime
Hi All
I want to control report direction(Left_To_Right or Right_To_Left) at runtime.
to make every thing is clear I want to call the report from Form passing parameter ,according the parameter the direction should be directed
Yes, it work and I was know it, for this reason I emphasis that I created control at "DESIGN time", I want to change the direction of controls that created at design time not creating at runtime with var tf:TLFTextField = new TLFTextField();
To reproduce the problem create TLFText on your scene with text tool and name it "MyText" then
var tf:TLFTextField = MyText; // instead new TLFTextField();
..rest of your code
now you will see that nothing will be change! I struggled many hours but still no success.
Do you have any idea in this case?
Similar Messages
-
How to change TLFTextField direction at runtime?
I create a TLFTextField object at design time and need to change its direction at runtime, how this could be possible?
the following code did not work and simply ignored:
var myText:TLFTextField = MyText;
myText.textFlow.direction = "rtl";
What should I do?Yes, it work and I was know it, for this reason I emphasis that I created control at "DESIGN time", I want to change the direction of controls that created at design time not creating at runtime with var tf:TLFTextField = new TLFTextField();
To reproduce the problem create TLFText on your scene with text tool and name it "MyText" then
var tf:TLFTextField = MyText; // instead new TLFTextField();
..rest of your code
now you will see that nothing will be change! I struggled many hours but still no success.
Do you have any idea in this case? -
How to change report displayname at runtime when run from the report server?
hi all,
with the reportviewer widget in a winforms app, i'm able to change report displayname at runtime by handling thesubmittingparametervalues event like so:
private void reportViewer1_SubmittingParameterValues(object sender, ReportParametersEventArgs e)
string po = e.Parameters["Order"].Values[0];
this.reportViewer1.ServerReport.DisplayName = "Load Out - " + po + " - " + DateTime.Now.ToShortDateString();
question: how do i achieve the same thing when the report is run via the ssrs reportserver website?
thanks for any tips,
sffHi sherifffruitfly2,
According to your description, you want to change the display name of report in Report Manager. Right?
In Reporting Services, we can't make the report file name dynamically. But we have Build-in Fields to show report name and execution time in a report. We can add a textbox and put in the expression below:
="Load on- "+Globals!ReportName+" "+Globals!ExecutionTime
It will show the report name with execution time when we run the report:
Reference:
Built-in Collections in Expressions (Report Builder and SSRS)
If you have any question, please feel free to ask.
Best Regards,
Simon Hou -
Urgent: how to run report from forms runtime
hi
can anybody tell me how to call reports in forms through menu
i just forgot how to call...
exact menu item code!!
rgds,Dear
if u are using client server then use this code
Run_Product(REPORTS, 'd:\emp.rep', ASYNCHRONOUS, RUNTIME,
FILESYSTEM, 'x', NULL);
if u r wsing web then use this code
Web.Show_Document('/reports/rwservlet?server=myrepserv&report=test.rdf&userid=scott/tiger@mydb&desformat=pdf&destype=c
ache¶mform=yes', '_blank');
M Rizwan -
How to run reports directly from R/3 tables
We are about to implement BW but the client wants to run temporary reports directly off R/3 tables. How can this be accomplished? Do we just use business content or r there other ways?
ThanksI created a join of 3 tables using SQVI in BI 7.0. Nobody else but me can see this query join. Is there a way to save this to somwhere public, so others can access this view? Maybe "Save As"??
If possible, please provide steps to do this.
Thank in advance! -
How to control application direction?
There are three links on my home page which require that a user be authenticated prior to the page being displayed. I have built a simple bean which accepts a userid and password and successfully authenticates the user. Now, how do I determine which page to display depending on the link the user clicked from the home page. My thought was a session bean which would store the user and currentpageID etc. Does that sound good? If so, how do I set the currentPageID on my home page when the user clicks a particular link? I know that sounds like a stupid question but I'm a real newbie...
regards,
MatOk,
I get the parameter passing thing. But how do I set it
if three links on the same page all direct the user to
the login.jsp? I think I have a mental block here...I
must be making this too hard :-) Can I include
something in the tags:
View Awards
View Reports
View Logs
which will set the parameter?
View Awards
View Reports
View Logs -
How To Control Af:panelspliter At Runtime
I have a panel splitter layout component on my page and i want to enable/disable this splitter at run time from within a managed bean
In my managed bean I made this method
public class ManageUI {
private String enableSplit;
private String discloseSplit;
private RichPanelSplitter spliter;
private String viewId;
public void doDiscloseSplit(PhaseEvent phaseEvent){
String currViewId = phaseEvent.getFacesContext().getViewRoot().getViewId();
System.out.println("current view id="+currViewId);
if (!currViewId.equals(this.getViewId())) {
spliter.setDisabled(false);
System.out.println("spliter is now false");
....the method throw runtime exception :
current view id=/home
<UIViewRoot> <notifyPhaseListeners> Exception
javax.el.ELException: java.lang.NullPointerExceptionWhy are you doing this in a phase listener?
Why not something like:
public boolean isSplitterDisabled()
return something;
}And bind the disabled property of the splitter to that?
To help you find which line is throwing the NPE, you can use the debugger.
John -
I am a new one in oracle and want to know how to hide report engin at runtime....
Can anybody help me.....
Thank you
FarhanThe following coding will help you to hide oracle report engin,
ADD_PARAMETER(idparam,'ORACLE_SHUTDOWN',TEXT_PARAMETER,'YES'); -
How to generate a report direct in PDF with oracle developer 6i
hi all
Please help me about this issue.
THAT How to generate a report directly in PDF using oracle developer 6i.
Regards
Yousuf Ahmed SiddiquiHi,
You can create the Report directly in PDF by setting some of the Report Parameters
i.e. DESTYPE, DESNAME AND DESFORMAT as follows before calling the Report.
DECLARE
PL_ID PARAMLIST;
PL_NAME VARCHAR2(10) := 'param_list';
BEGIN
PL_ID := GET_PARAMETER_LIST (PL_NAME);
IF NOT ID_NULL (PL_ID) THEN
Destroy_Parameter_List(PL_ID);
END IF;
PL_ID := Create_Parameter_List(PL_NAME);
Add_Parameter (PL_ID, 'DESTYPE', TEXT_PARAMETER, 'FILE');
Add_Parameter (PL_ID, 'DESNAME', TEXT_PARAMETER, 'c:\test.pdf');
Add_Parameter (PL_ID, 'DESFORMAT', TEXT_PARAMETER, 'PDF');
RUN_PRODUCT (REPORTS, 'REPORT_NAME', ASYNCHRONOUS, RUNTIME, FILESYSTEM, PL_ID, NULL);
END;Hope this helps.
Best Regards
Arif Khadas
Edited by: Arif Khadas on Apr 22, 2010 9:24 AM -
Hi,
Currently, we are using crystal report to all of our reporting applications, but since I/users have encountered some issues about CR's speed to load only a simple report, maybe it is now time for us to adopt a new reporting environment in which I think SSRS
can fill this problem.
To start with, I have here a sample code, that uses the crystal report to print the report directly without previewing:
csCashInvoiceCal csCashCal; --Crystal report name .rpt
dsCsReceipt dsCs; --created dataset
DataTable u;
DataRow s;
private System.Drawing.Printing.PrintDocument printDocument1;
private System.Windows.Forms.PrintDialog printDialog1;
ParameterValues paramValue;
ParameterDiscreteValue discreteValue;
ParameterFieldDefinition fieldDefinition;
private void btnPrint_Click(object sender, EventArgs e)
this.Cursor = Cursors.WaitCursor;
loadReceipt2();
print2();
csCashCal.Close();
this.Cursor = Cursors.Default;
private void loadReceipt2()
dsCs = new dsCsReceipt(); --created dataset
u = dsCs.Tables.Add("DtCsReceipt");
u.Columns.Add("Qty", Type.GetType("System.String"));
u.Columns.Add("UOM", Type.GetType("System.String"));
u.Columns.Add("Description", Type.GetType("System.String"));
u.Columns.Add("UnitPrice", Type.GetType("System.String"));
u.Columns.Add("Discount", Type.GetType("System.String"));
u.Columns.Add("Amount", Type.GetType("System.String"));
try
for (int i = 0; i < dgvDesc.Rows.Count - 1; i++)
s = u.NewRow(); double.TryParse(dgvDesc.Rows[i].Cells[Discount2.Name].Value.ToString(), out discount);
s["Qty"] = double.Parse(dgvDesc.Rows[i].Cells[Qty.Name].Value.ToString());
s["UOM"] = dgvDesc.Rows[i].Cells[Uom2.Name].Value.ToString();
s["Description"] = invcode + dgvDesc.Rows[i].Cells[Description.Name].Value.ToString();
s["UnitPrice"] = dgvDesc.Rows[i].Cells[UnitPrice.Name].Value.ToString();
if (discount != 0)
s["Discount"] = "(" + string.Format("{0:0.##}", discount) + "%)";
else
s["Discount"] = "";
s["Amount"] = dgvDesc.Rows[i].Cells[Amount2.Name].Value.ToString();
u.Rows.Add(s);
catch (Exception) { }
csCashCal = new csCashInvoiceCal();
csCashCal.SetDataSource(dsCs.Tables[1]);
//csCashCal.Refresh();
loadParameter2();
private void loadParameter2()
ParameterFieldDefinitions paramFieldDefinitions;
paramValue = new ParameterValues();
discreteValue = new ParameterDiscreteValue();
paramFieldDefinitions = csCashCal.DataDefinition.ParameterFields;
discreteValue.Value = date;
fieldDefinition = paramFieldDefinitions["Date"];
commonParam();
discreteValue.Value = txtcsno.Text;
fieldDefinition = paramFieldDefinitions["InvoiceNo"];
commonParam();
discreteValue.Value = txtNameTo.Text;
fieldDefinition = paramFieldDefinitions["CustomerName"];
commonParam();
discreteValue.Value = txtAdd.Text;
fieldDefinition = paramFieldDefinitions["CustomerAddress"];
commonParam();
------other parameters----
private void commonParam()
paramValue.Clear();
paramValue.Add(discreteValue);
fieldDefinition.ApplyCurrentValues(paramValue);
private void print2()
using (printDocument1 = new System.Drawing.Printing.PrintDocument())
using (this.printDialog1 = new PrintDialog())
//this.printDialog1.UseEXDialog = true;
this.printDialog1.Document = this.printDocument1;
DialogResult dr = this.printDialog1.ShowDialog();
if (dr == DialogResult.OK)
int nCopy = this.printDocument1.PrinterSettings.Copies;
int sPage = this.printDocument1.PrinterSettings.FromPage;
int ePage = this.printDocument1.PrinterSettings.ToPage;
string PrinterName = this.printDocument1.PrinterSettings.PrinterName;
try
csCashCal.PrintOptions.PrinterName = PrinterName;
csCashCal.PrintToPrinter(nCopy, false, sPage, ePage);
printcount++;
//saveCountPrint();
catch (Exception err)
MessageBox.Show(err.ToString());
This is only a simple sales receipt application that uses dgv and textboxes to push its data to dataset to the crystal report, a simple one but there are instances that it is very slow.
But I'm having trouble implementing this using SSRS, since I'm only new to this one, wherein I created the report using report wizard, with two button options inside the form for print preview or direct print selection. Actually, it is very easy to implement
with print preview because it uses reportviewer. My problem is that how can I print the report directly without using a reportviewer?
So here is my code so far which I don't know what's next:
private void button2_Click(object sender, EventArgs e)
this.Cursor = Cursors.WaitCursor;
loadReceipt3();
//print3();
this.Cursor = Cursors.Default;
ReportParameter[] parameter = new ReportParameter[11];
private void loadParameter3()
parameter[0] = new ReportParameter("InvoiceNo", txtcsno.Text);
parameter[1] = new ReportParameter("Date", date);
parameter[2] = new ReportParameter("CustomerTin", txtTin.Text);
parameter[3] = new ReportParameter("CustomerName", txtNameTo.Text);
parameter[4] = new ReportParameter("CustomerAddress", txtAdd.Text);
parameter[5] = new ReportParameter("Agent", agent);
parameter[6] = new ReportParameter("Discount", "Discount: ");
parameter[7] = new ReportParameter("TotalDiscount", lblDiscount.Text + "%");
parameter[8] = new ReportParameter("TotalSales", rdtotal);
parameter[9] = new ReportParameter("Tax", rdtax);
parameter[10] = new ReportParameter("TotalAmount", rdnet);
private void loadReceipt3()
DataSet dsrs = new DataSet();
DataTable dtrs = new DataTable();
DataRow drs;
dtrs.Columns.Add("Qty", Type.GetType("System.String"));
dtrs.Columns.Add("UOM", Type.GetType("System.String"));
dtrs.Columns.Add("Description", Type.GetType("System.String"));
dtrs.Columns.Add("UnitPrice", Type.GetType("System.String"));
dtrs.Columns.Add("Discount", Type.GetType("System.String"));
dtrs.Columns.Add("Amount", Type.GetType("System.String"));
try
for (int i = 0; i < dgvDesc.Rows.Count - 1; i++)
drs = dtrs.NewRow();
drs["Qty"] = double.Parse(dgvDesc.Rows[i].Cells[Qty.Name].Value.ToString());
drs["UOM"] = dgvDesc.Rows[i].Cells[Uom2.Name].Value.ToString();
drs["Description"] = invcode + dgvDesc.Rows[i].Cells[Description.Name].Value.ToString();
drs["UnitPrice"] = dgvDesc.Rows[i].Cells[UnitPrice.Name].Value.ToString();
if (discount != 0)
drs["Discount"] = "(" + string.Format("{0:0.##}", discount) + "%)";
else
drs["Discount"] = "";
drs["Amount"] = dgvDesc.Rows[i].Cells[Amount2.Name].Value.ToString();
dtrs.Rows.Add(s);
catch (Exception) { }
int addtlRow = 7;
if (addtlRow > (count - 1))
addtlRow = addtlRow - (count - 1);
for (int i = 0; i < addtlRow; i++)
dtrs.Rows.Add();
loadParameter3();
LocalReport localreport = new LocalReport();
localreport.SetParameters(parameter);
localreport.DataSources.Clear();
localreport.DataSources.Add(new ReportDataSource("dsSalesReceiptSsrs", dtrs));
localreport.Refresh();
//what's next....
So what's next after local..refresh()? Actually, I have googled a lot but I didn't found the exact solution that I'm looking for which confuses me a lot.
Anyway I'm using VS 2010 with sql server 2012 express.
You're help will be greatly appreciated.
Thank you,
HardzAfter some further studies with ReportViewer controls and with the use of this tutorial @ : http://msdn.microsoft.com/en-us/library/ms252091.aspx, which helps me a lot on how to print a report without using a report viewer, I found out what is missing
with my code above and helps solve my question.
Here's the continuation of the code above:
private void loadReceipt3()
loadParameter3();
LocalReport localreport = new LocalReport();
localreport.ReportPath = @"..\..\SsrsCashReceipt.rdlc";
localreport.SetParameters(parameter);
localreport.DataSources.Clear();
localreport.DataSources.Add(new ReportDataSource("dsSalesReceiptSsrs", dtrs));
Export(localreport);
print4();
private IList<Stream> m_streams;
private int m_currentPageIndex;
private void Export(LocalReport report)
string deviceInfo =
@"<DeviceInfo>
<OutputFormat>EMF</OutputFormat>
<PageWidth>8.5in</PageWidth>
<PageHeight>11in</PageHeight>
<MarginTop>0.25in</MarginTop>
<MarginLeft>0.25in</MarginLeft>
<MarginRight>0.25in</MarginRight>
<MarginBottom>0.25in</MarginBottom>
</DeviceInfo>";
Warning[] warnings;
m_streams = new List<Stream>();
report.Render("Image", deviceInfo, CreateStream,
out warnings);
foreach (Stream stream in m_streams)
stream.Position = 0;
private void print4()
if (m_streams == null || m_streams.Count == 0)
throw new Exception("Error: no stream to print.");
PrintDocument printDoc = new PrintDocument();
PrintDialog printDlg = new PrintDialog();
printDlg.Document = printDoc;
DialogResult dr = printDlg.ShowDialog();
if (dr == DialogResult.OK)
if (!printDoc.PrinterSettings.IsValid)
throw new Exception("Error: cannot find the default printer.");
else
printDoc.PrintPage += new PrintPageEventHandler(PrintPage);
m_currentPageIndex = 0;
printDoc.Print();
Dispose();
public void Dispose()
if (m_streams != null)
foreach (Stream stream in m_streams)
stream.Close();
m_streams = null;
private Stream CreateStream(string name, string fileNameExtension, Encoding encoding, string mimeType, bool willSeek)
Stream stream = new FileStream(name + "." + fileNameExtension,
FileMode.Create);
m_streams.Add(stream);
return stream;
private void PrintPage(object sender, PrintPageEventArgs ev)
Metafile pageImage = new
Metafile(m_streams[m_currentPageIndex]);
// Adjust rectangular area with printer margins.
Rectangle adjustedRect = new Rectangle(
ev.PageBounds.Left - (int)ev.PageSettings.HardMarginX,
ev.PageBounds.Top - (int)ev.PageSettings.HardMarginY,
ev.PageBounds.Width,
ev.PageBounds.Height);
// Draw a white background for the report
ev.Graphics.FillRectangle(Brushes.White, adjustedRect);
// Draw the report content
ev.Graphics.DrawImage(pageImage, adjustedRect);
// Prepare for the next page. Make sure we haven't hit the end.
m_currentPageIndex++;
ev.HasMorePages = (m_currentPageIndex < m_streams.Count);
Thank you very much for this wonderful tutorial. :) -
How do I change report DSN at runtime?
Hello,
I have some reports (some 2011 but most 9) that were created with a DSN named Dev for example. When the reports are deployed to production, they are viewed via an ASP.NET application written in VB.NET (VS2012). The production server has a DSN named Prod for example. The code I'm using to change the connection information "seems" to be working because if I write out the connection info before the code, it shows the Dev DSN connection information and if I write out the connection inf after the code, it shows the Prod DSN connection information.
The problem is that even though the connection information appears to be changing at runtime, when the report renders it shows data from the Dev database instead of production.
Here is the code I'm using to change the main report connection and the subreports, which seems to be working:
Dim strPassword As String = System.Configuration.ConfigurationManager.AppSettings("ReportPassword")
Dim strUserID As String = System.Configuration.ConfigurationManager.AppSettings("ReportUser")
Dim strServer As String = System.Configuration.ConfigurationManager.AppSettings("ReportServer")
Dim strDBName As String = System.Configuration.ConfigurationManager.AppSettings("ReportDatabase")
Dim strDSName As String = System.Configuration.ConfigurationManager.AppSettings("ReportDSN")
Dim myTable As CrystalDecisions.CrystalReports.Engine.Table
Dim myLogin As CrystalDecisions.Shared.TableLogOnInfo
Dim blDebugFlag As Boolean = False
'This test is needed because the flag may/should not exist in the production web.config
If Not System.Configuration.ConfigurationManager.AppSettings("debugFlag") Is Nothing Then
blDebugFlag = System.Configuration.ConfigurationManager.AppSettings("debugFlag")
End If
'Modify the data source location for each table in the report (does not include subreports)
strReturnData += Now.ToLongTimeString & "<br>"
For Each myTable In Session("crpt").Database.Tables
myLogin = myTable.LogOnInfo
strReturnData += "<br><br>Table = [<b>" & myTable.Name.ToString & "</b>] - (Main report)" & _
"<blockquote>" & _
"<br>Original ServerName = [" & myLogin.ConnectionInfo.ServerName.ToString & "]" & _
"<br>Original DatabaseName = [" & myLogin.ConnectionInfo.DatabaseName.ToString & "]" & _
"<br>Original UserId = [" & myLogin.ConnectionInfo.UserID.ToString & "]"
'check if a DSN or non-DSN connection
If myTable.LogOnInfo.ConnectionInfo.DatabaseName = "" Or myTable.LogOnInfo.ConnectionInfo.ServerName = "Dev" Then
myLogin.ConnectionInfo.ServerName = strDSName
myLogin.ConnectionInfo.DatabaseName = ""
strReturnData += "<br><br> ### DSN Connection ###"
Else
myLogin.ConnectionInfo.ServerName = strServer
myLogin.ConnectionInfo.DatabaseName = strDBName
strReturnData += "<br><br> *** Non-DSN Connection ***"
End If
myLogin.ConnectionInfo.Password = strPassword
myLogin.ConnectionInfo.UserID = strUserID
myTable.ApplyLogOnInfo(myLogin)
' Collect the login information after-the-fact
strReturnData += "<br><br>Final ServerName = [" & myLogin.ConnectionInfo.ServerName.ToString & "]" & _
"<br>Final DatabaseName = [" & myLogin.ConnectionInfo.DatabaseName.ToString & "]" & _
"<br>Final UserId = [" & myLogin.ConnectionInfo.UserID.ToString & "]" & _
"</blockquote>"
Next
'Iterate through subreports and make sure ConnectionInfo matches the main report
'set the crSections object to the current report's sections
Dim crSections As CrystalDecisions.CrystalReports.Engine.Sections = Session("crpt").ReportDefinition.Sections 'rpt.ReportDefinition.Sections
Dim crReportobjects As ReportObjects, crSubReportobject As SubreportObject, crSubReportDocument As ReportDocument
Dim crDatabase As Database, crTables As Tables
Dim crtableLogoninfo As New TableLogOnInfo
Dim crConnectioninfo As New ConnectionInfo
'loop through all the sections to find all the report objects
For Each crSection As CrystalDecisions.CrystalReports.Engine.Section In crSections
crReportObjects = crSection.ReportObjects
'loop through all the report objects to find all the subreports
For Each crReportObject As CrystalDecisions.CrystalReports.Engine.ReportObject In crReportObjects
If crReportObject.Kind = ReportObjectKind.SubreportObject Then
'you will need to typecast the reportobject to a subreport object once you find it
crSubreportObject = DirectCast(crReportObject, CrystalDecisions.CrystalReports.Engine.SubreportObject)
Dim mysubname As String = crSubreportObject.SubreportName.ToString()
'open the subreport object
crSubreportDocument = crSubreportObject.OpenSubreport(crSubreportObject.SubreportName)
'set the database and tables objects to work with the subreport
crDatabase = crSubreportDocument.Database
crTables = crDatabase.Tables
'loop through all the tables in the subreport and set up the connection info and apply it to the tables
For Each crTable As CrystalDecisions.CrystalReports.Engine.Table In crTables
'With crConnectioninfo
' .ServerName = strDSName
' .DatabaseName = ""
' .UserID = strUserID
' .Password = strPassword
'End With
'crtableLogoninfo = crTable.LogOnInfo
'crtableLogoninfo.ConnectionInfo = crConnectioninfo
'crTable.ApplyLogOnInfo(crtableLogoninfo)
myLogin = crTable.LogOnInfo
strReturnData += "<br><br>Table = [<b>" & crTable.Name.ToString & "</b>] - (Subreport - [" & mysubname & "])" & _
"<blockquote>" & _
"<br>Original ServerName = [" & myLogin.ConnectionInfo.ServerName.ToString & "]" & _
"<br>Original DatabaseName = [" & myLogin.ConnectionInfo.DatabaseName.ToString & "]" & _
"<br>Original UserId = [" & myLogin.ConnectionInfo.UserID.ToString & "]"
'check if a DSN or non-DSN connection
If crTable.LogOnInfo.ConnectionInfo.DatabaseName = "" Or crTable.LogOnInfo.ConnectionInfo.ServerName = "Dev" Then
myLogin.ConnectionInfo.ServerName = strDSName
myLogin.ConnectionInfo.DatabaseName = ""
strReturnData += "<br><br> ### DSN Connection ###"
Else
myLogin.ConnectionInfo.ServerName = strServer
myLogin.ConnectionInfo.DatabaseName = strDBName
strReturnData += "<br><br> *** Non-DSN Connection ***"
End If
myLogin.ConnectionInfo.Password = strPassword
myLogin.ConnectionInfo.UserID = strUserID
crtableLogoninfo = crTable.LogOnInfo
crtableLogoninfo.ConnectionInfo = myLogin.ConnectionInfo
crTable.ApplyLogOnInfo(crtableLogoninfo)
' Collect the login information after-the-fact
strReturnData += "<br><br>Final ServerName = [" & myLogin.ConnectionInfo.ServerName.ToString & "]" & _
"<br>Final DatabaseName = [" & myLogin.ConnectionInfo.DatabaseName.ToString & "]" & _
"<br>Final UserId = [" & myLogin.ConnectionInfo.UserID.ToString & "]" & _
"</blockquote>"
Next 'crTable
End If
Next 'crReportObject
Next 'crSection
Here is what gets printed after this code when the debug flag is True:
Table = [usp_MainReportProcedureName] - (Main report)
Original ServerName = [Dev]
Original DatabaseName = [Dev]
Original UserId = [UserName]
### DSN Connection ###
Final ServerName = [Prod]
Final DatabaseName = []
Final UserId = [UserName]
Table = [usp_SubreportProcedureName] - (Subreport - [subrptName.rpt])
Original ServerName = [Dev]
Original DatabaseName = [Dev]
Original UserId = [UserName]
### DSN Connection ###
Final ServerName = [Prod]
Final DatabaseName = []
Final UserId = [UserName]
Here is the export code that renders the report:
'Export to new format
Dim crExportOptions As New ExportOptions
Dim crDiskFileDestinationOptios As New DiskFileDestinationOptions
Dim fname As String = ""
Dim gFileId As New Guid
Try
'Filename for temporary report
fname = System.Configuration.ConfigurationManager.AppSettings("DocumentsLocation") + gFileId.ToString + ".pdf"
crDiskFileDestinationOptios.DiskFileName = fname
crExportOptions = Session("crpt").ExportOptions
Session("crpt").ExportOptions.DestinationOptions = crDiskFileDestinationOptios
Session("crpt").ExportOptions.ExportDestinationType = ExportDestinationType.DiskFile
Session("crpt").ExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat
Session("crpt").Export()
'Display and Cleanup
Response.ClearContent()
Response.ClearHeaders()
If blDebugFlag = False Then
'Display the report
Response.ContentType = "application/pdf"
Response.WriteFile(fname) 'writes out PDF if created
Else
'Display connection information for debugging
'*** DEBUG CODE *** for use in TEST ENVIRONMENTS ONLY
Response.Write(strReturnData)
End If
Catch ex As Exception
Session("error") = ex.ToString
'Add the location of the error
Session("error") = "[Address: " & Request.Url.ToString & "] " & Session("error")
Response.Redirect("ErrorEvents.aspx")
Finally
Response.Flush()
'Response.Close() 'Prevents pdf's from rendering in Chrome
System.IO.File.Delete(fname)
GC.Collect()
End Try
I'm wondering if there is some additional code needed after .ApplyLogOnInfo or if there are some other parameters needed when exporting after the connection info has been changed or if there is something else I'm missing.
Thanks for your help.Thank you for the troubleshooting ideas.
The version of the Crystal Runtime on the web server is: CRRuntime_32bit_13_0_6.msi
The database is on an SQL Server 2008 separate server
I started with adding this code just before the export code right after all the looping to change the connection info:
Session("crpt").Refresh()
Session("crpt").VerifyDatabase()
I tried running a report and an error was raised a few lines later at:
Session("crpt").Export()
Here is the error message:
CrystalDecisions.CrystalReports.Engine.ParameterFieldCurrentValueException: Missing parameter values. ---> System.Runtime.InteropServices.COMException: Missing parameter values.
at CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.Export(ExportOptions pExportOptions, RequestContext pRequestContext)
at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext) --- End of inner exception stack trace ---
at Microsoft.VisualBasic.CompilerServices.Symbols.Container.InvokeMethod(Method TargetProcedure, Object[] Arguments, Boolean[] CopyBack, BindingFlags Flags)
at Microsoft.VisualBasic.CompilerServices.NewLateBinding.CallMethod(Container BaseReference, String MethodName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, BindingFlags InvocationFlags, Boolean ReportErrors, ResolutionFailure& Failure)
at Microsoft.VisualBasic.CompilerServices.NewLateBinding.ObjectLateCall(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, Boolean IgnoreReturn)
at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateCall(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, Boolean IgnoreReturn)
Next, I commented out those added lines (refresh and verify) and tried renaming the Dev DSN to Devxxx on the web application server.
I'm at a loss but somehow the report rendered still showing data from the Dev database. I checked the Prod DSN just to be sure it was pointed at the Prod database and it is. I rebooted the server and still got the same results. I opened the report directly in CR 2011 on the web server and tried to preview it. The ODBC dialog came up and the Devxxx DSN was there.
I changed some data in Dev ran the report through the web application in Prod and the data on the report showed the changed data in Dev.
The web application says the report connection info is for Dev and then it is changed for Prod and then even though the Dev DSN no longer exits the report still renders from Dev data???
I'm totally confused as to how this can be but maybe if we can solve the refresh and verify error the DSN mystery will become mute. -
How Can I print directly the report from the printer without showing it ?
I know how to run the report from Form as it illustrate on this site:
http://www.lv2000.com/articles/runreport.htm
but the question here how could i to generate the report directly to the printer without showing it on the screen???
I search on the net and I find that I should change this line :-
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESTYPE, cache);
to this
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESTYPE, printer);
but it is not working with me :-(
is there any suggest ?!Check if any of these helps
Re: Direct Printing in Forms10g
Web.Show_Document() print report directly
Direct Printing from client PC -
How we can print directly a report without preview to a local printer in web
How we can print directly a report without preview to a local printer in web-environment, whith Oracle 9ias Report server release 6i patch 11.
The user want to print ticket, built by Oracle Report, without previuw on PDF format, in a web three-tier environment.
Please supply my documentation in detail and sample code if you can.Hello,
Take a look to the example provided in the note :
Note.253881.1 How to Create a Report With a Frame Only on the Last Page at a Fixed Position
Regards -
How to print a report directly on to a printer on the client machine
Hi,
Could anyone let me know how to print a report directly on to the clients default printer in oracle forms 10g with OAS?.
Regards,
Prasad.Hello,
<p>You can use this Java Bean</p>
Francois -
How to export an alv report directly to crystal report?
hi gurus,
we are looking for the possible ways of integrating alv and crystal report.
we want to keep the abap reports , because of the logical database and the selection screen, and
use alv to present the result data, if users want to tailor the layout we want to switch to crystal report directly from sapgui.
is that possible ?
thanks and best regards.
zjHi Eric,
Please check this link for sample code regarding LOGO to Excel
How to Download ALV Output LOGO to Excel ?
For Header to Excel check this link
Export header of alv-oo into excel
Hope this would help you.
Good luck
Narin
Maybe you are looking for
-
Nokia Maploader problem with N95
No i do not have a connectivity error with Maploader. I cannot start the program at all. After installing. I click on the program then I see a splashscreen. And under the splashscreen I see a message saying That maploader is a program to transfer map
-
I agree to itunes update sends email to me and no place lets me check that i agree so what am i suppose to do ?
-
SharePoint - InfoPath - File Attachment Control Problem
Hi, I have problem with File Attachment Control. If I open form via internet browser in dialog mode next I click "Attachment Button", browser automatically open form in new tab without dialog. Any ideas?
-
Cannot execute GR(MIGO)
Hi All, There is a user ABC who is operating the production order X The user cannot carry the GR (MIGO ). The error note is shown as below:- Production Order X is already being processed by user ABC Message no. CO469 Diagnosis User ABC is blocking
-
I just loaded Firefox onto my laptop. I set up the the sync add on and had no errors. When I hit sync now I get "Sync encountered an error while syncing: Firefox sync server maintenance is underway, syncing will resume automatically." I have gotten t