Filltering in the report
Hi All,
I have a requirement where i need to ristrict the data in the report level.
I have a code in the strart routine in ODS to Cube.
Now i need to replicate the same data from ODS to report (not from Cube)
below is the code in start routine ( ODS to Cube)
LOOP AT DATA_PACKAGE.
IF NOT ( DATA_PACKAGE-BBP_RELCON = 'I1022' AND ( DATA_PACKAGE-BBP_TRANBE = 'X'
OR DATA_PACKAGE-BBP_TRACON = 'I1018' ) ) .
DELETE DATA_PACKAGE.
endif.
endloop.
Could you please let me know how i can filter my query in order to get the same result from ODS as Cube.
Thanks,
Ravi.
Drag these corresponding infoobjects in FILTER section in query designer and assign appropriate values. Also take care to see if you need to INCLUDE or EXCLUDE values. Its pretty simple filter.
Abhijit
Similar Messages
-
Can not refresh data int the report...
Application on C#.
Steps:
1. Get Report without data from the database
2. Change the dataconnections in report to the current user
3. refresh data on the report (FilePath = TempFilePath)
4. Resave report file with data
5. Automatically open CrystalReportsViewer2008 and load the report
Result
On developer machine is allright, but on the user machine data isn't refreshed. Therefore CrysrtalReportsViewer2008 can't open report. It say that check the SaveDatawithReport parameter.
In process I found that in temp directory on user pc, didn't creates some temprorary files which creates on developer PC. Why? Help me please.
Sorry for my English.There is the code of my programm
function ParseReport is refreshed the data and change dataconnections for current user
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Diagnostics;
using CRApp;
using Microsoft.Win32;
namespace CRApp
* u041Au043Bu0430u0441u0441 u0434u043Bu044F u0430u0432u0442u043Eu043Cu0430u0442u0438u0437u0438u0440u043Eu0432u0430u043Du043Du043Eu0433u043E u0432u0438u0437u0443u0430u043Bu044Cu043Du043Eu0433u043E u0434u043Eu0441u0442u0443u043Fu0430
* u043A u0444u0430u0439u043Bu0430u043C u0448u0430u0431u043Bu043Eu043Du043Eu0432, u0441u0433u0435u043Du0435u0440u0438u0440u043Eu0432u0430u043Du043Du044Bu0445 u0432
* u043Fu0440u043Eu0433u0440u0430u043Cu043Cu0435 Crystal Reports
public partial class Export2CR_MForm : Form
public Export2CR_MForm()
InitializeComponent();
Start();
public void Start()
LoginForm Login = new LoginForm();
DialogResult Dres = Login.ShowDialog();
if (Dres == DialogResult.OK)
if (Login.GetConStr().ToString() != "")
GetReportNamesFromDataBase(Login.GetConStr());
SetConnectionString(Login.GetConStr());
this.CenterToScreen();
Visible = true;
Login.Close();
else
Login.Close();
this.CenterToScreen();
this.OnClosed(null);
* u041Fu043Eu043Bu0443u0447u0430u0435u043C u043Fu0443u0442u044C u043A u0432u0440u0435u043Cu0435u043Du043Du044Bu043C u0444u0430u0439u043Bu0430u043C
TempFilePath = Path.GetTempPath();
* u041Au0440u0438u0441u0442u0430u043Bu043Eu0432u0441u043Au0438u0439 u0432u044Cu044Eu0432u0435u0440u043Eu043A
CrystalDecisions.Windows.Forms.CrystalReportViewer viewer;
* u041Fu0443u0442u044C u043A u0432u0440u0435u043Cu0435u043Du043Du043Eu0439 u043Fu0430u043Fu043Au0435
private string TempFilePath;
* u041Fu0430u0440u0430u043Cu0435u0442u0440 u0437u0430u043Fu0438u0441u0438 u0432 u0440u0435u0436u0438u043Cu0435, u0442u0430u0431u043Bu0438u0446u0435 (u0438u0442u0434...)
* u041Du0443u0436u0435u043D u0434u043Bu044F u0442u043Eu0433u043E u0447u0442u043Eu0431u044B u0432u044Bu0431u0438u0440u0430u0442u044C
* u043Eu043Fu0435u0440u0435u0434u043Bu0451u043Du043Du044Bu0439 u0434u0430u0442u0430u0441u0435u0442, u0441u043Eu043Eu0442u0432u0435u0442u0441u0442u0432u0443u044Eu0449u0438u0439 u0432u044Bu0431u0440u0430u043Du043Du043Eu0439 u0437u0430u043Fu0438u0441u0438
private int ObjectIDOfTemplate;
* u0423u0441u0442u0430u043Du043Eu0432u043Au0430 u0437u043Du0430u0447u0435u043Du0438u044F ObjectIDOfTemplate
public void SetObjectIDOfTemplate(int /*
* ObjectID u0442u043Eu0433u043E u0448u0430u0431u043Bu043Eu043Du0430,
* u043Au043Eu0442u043Eu0440u044Bu0439 u043Du0430u0434u043E u043Fu043Eu043Bu0443u0447u0438u0442u044C
EnternalObjectID)
ObjectIDOfTemplate = EnternalObjectID;
* u041Fu043Eu043Bu0443u0447u0438u0442u044C ObjectID u0448u0430u0431u043Bu043Eu043Du0430
* u0441 u043Au043Eu0442u043Eu0440u044Bu043C u0440u0430u0431u043Eu0442u0430u043Bu0438 u0434u043Bu044F
* u0438u0441u043Fu043Eu043Bu044Cu0437u043Eu0432u0430u043Du0438u044F u0435u0433u043E u0432u043Du0435 u0431u0438u0431u043Bu0438u043Eu0442u0435u043Au0438
public int GetObjectIDOfTemplate()
return ObjectIDOfTemplate;
* u041Fu0443u0442u044C u043A u0432u044Bu043Fu043Bu044Eu043Du0443u0442u043Eu043Cu0443 u0444u0430u0439u043Bu0443
private string TemplateFilePath;
* u0423u0441u0442u0430u043Du043Eu0432u0438u0442u044C u043Fu0443u0442u044C u043A
* u0432u044Bu043Fu043Bu044Eu043Du0443u0442u043Eu043Cu0443 u0444u0430u0439u043Bu0443
public void SetTemplateFilePath(string In)
TemplateFilePath = In;
* u041Fu043Eu043Bu0443u0447u0438u0442u044C u043Fu0443u0442u044C u043A
* u0432u044Bu043Fu043Bu044Eu043Du0443u0442u043Eu043Cu0443 u0444u0430u0439u043Bu0443
public string GetTemplateFilePath()
return TemplateFilePath;
* u0424u0443u043Du043Au0446u0438u044F u043Eu0442u043Au0440u044Bu0442u0438u044F u0444u0430u0439u043Bu0430,
* u043Fu043Eu043Bu0443u0447u0435u043Du043Du043Eu0433u043E u0438u0437 u0431u0430u0437u044B u0438
* u043Fu043Eu043Bu043Eu0436u0435u043Du043Du043Eu0433u043E u0432u043E u0432u0440u0435u043Cu0435u043Du043Du0443u044E u043Fu0430u043Fu043Au0443
public int ParseReport(string FilePath)
viewer = new CrystalDecisions.Windows.Forms.CrystalReportViewer();
CrystalDecisions.CrystalReports.Engine.ReportDocument rd =
new CrystalDecisions.CrystalReports.Engine.ReportDocument();
try
rd.Load(FilePath);
try
for (int i = 0; i < rd.DataSourceConnections.Count; i++)
rd.DataSourceConnections<i>.SetConnection(
GetConnectionString().GetServerName(),
GetConnectionString().GetDatabaseName(),
GetConnectionString().GetUserName(),
GetConnectionString().GetPassword()
for (int j = 0; j < rd.Database.Tables.Count; j++)
DataTable dataSet = new DataTable();
SqlConnection C = new SqlConnection(GetConnectionString().ToString());
string ViewName = GetDataViewName(GetConnectionString(), ParseTableName(
rd.Database.Tables[j].Name));
SqlCommand Q = new SqlCommand("select * from " + ViewName
, C);
Q.CommandType = CommandType.Text;
SqlDataAdapter adapter = new SqlDataAdapter();
adapter.SelectCommand = Q;
adapter.Fill(dataSet);
rd.Database.Tables[j].SetDataSource(dataSet);
catch (Exception e)
MessageBox.Show(e.Message);
try
SetTemplateFilePath(TempFilePath + "\\" + FileTreeView.SelectedNode.Text.ToString() + ".rpt");
rd.ReportOptions.EnableSaveDataWithReport = true;
viewer.ReportSource = rd;
viewer.RefreshReport();
rd.SaveAs(TemplateFilePath);
rd.Close();
return 0;
catch (Exception e)
MessageBox.Show(e.Message);
return -1;
catch (Exception ex)
rd.ReportOptions.EnableUseDummyData = true;
rd.ReportOptions.EnableSaveDataWithReport = true;
viewer.RefreshReport();
rd.SaveAs(TemplateFilePath);
MessageBox.Show("Error: Could not read file from disk. Original error: " + ex.Message);
return -1;
* u0420u0430u0437u0431u0438u0435u043Du0438u0435 u0438u043Cu0435u043Du0438 u0442u0430u0431u043Bu0438u0446u044B
* u0434u043Bu044F u043Fu043Eu043Bu0443u0447u0435u043Du0438u044F u043Du043Eu043Cu0435u0440u0430 u043Au043Bu0430u0441u0441u0430
public string ParseTableName(string TableName)
// MessageBox.Show(TableName);
int x = 0;
if (TableName.Contains("Class"))
x = TableName.LastIndexOf("s");
return TableName.Remove(0,x+1);
if(TableName.Contains("Attr"))
x = TableName.IndexOf("r");
// MessageBox.Show(x.ToString());
// MessageBox.Show(TableName.Remove(0, x+1));
return TableName.Remove(0, x+1);
* u0424u0443u043Du043Au0446u0438u044F u043Fu043Eu043Bu0443u0447u0435u043Du0438u044F u0444u0430u0439u043Bu0430 u0438u0437 u0431u0430u0437u044B
public int ParseReportWithDataBase()
try
string ConnectionString = GetConnectionString().ToString();
SqlConnection C = new SqlConnection(ConnectionString);
C.Open();
string SelectString = "select P119 from "+ GetDataViewName(GetConnectionString(),"24") +" where P115='";
SelectString = SelectString+FileTreeView.SelectedNode.Text.ToString()+"'";
SqlCommand Q = new SqlCommand(SelectString, C);
Q.CommandType = CommandType.Text;
SqlDataAdapter adapter = new SqlDataAdapter();
adapter.SelectCommand = Q;
DataTable table = new DataTable();
adapter.Fill(table);
byte[] b = (byte[])table.Rows[0].ItemArray.GetValue(0);
FileStream fs = File.Create(TempFilePath+"\\"+FileTreeView.SelectedNode.Text.ToString()+".rpt");
fs.Write(b, 0, b.Length);
fs.Close();
C.Close();
return 0;
catch (Exception ex)
MessageBox.Show(ex.Message);
return -1;
* u0421u0442u0440u0443u043Au0442u0443u0440u0430, u043Eu043Fu0438u0441u044Bu0432u0430u044Eu0449u0430u044F u043Fu0430u0440u0430u043Cu0435u0442u0440u044B
* u043Fu043Eu0434u043Au043Bu044Eu0447u0435u043Du0438u044F u043A u0431u0430u0437u0435 u0434u0430u043Du043Du044Bu0445,
* u043Au0430u043A u0434u043Bu044F u0432u043Du0435u0448u043Du0435u0433u043E u0438u0441u043Fu043Eu043Bu044Cu0437u043Eu0432u0430u043Du0438u044F
* u0442u0430u043A u0438 u0434u043Bu044F u0432u043Du0443u0442u0440u0435u043Du043Du0435u0433u043E
public struct ConnectionString
* u0418u043Cu044F u0441u0435u0440u0432u0435u0440u0430 u0431u0430u0437u044B u0434u0430u043Du043Du044Bu0445
private string DataSource_Value;
* u041Du0430u0437u0432u0430u043Du0438u0435 u0431u0430u0437u044B u0434u0430u043Du043Du044Bu0445
private string InitialCatalog_Value;
* u0418u043Cu044F u043Fu043Eu043Bu044Cu0437u043Eu0432u0430u0442u0435u043Bu044F
private string UserID_Value;
* u041Fu0430u0440u043Eu043Bu044C
private string Password_Value;
* u041Fu0435u0440u0435u0433u0440u0443u0436u0435u043Du043Du044Bu0439 u043Au043Eu043Du0441u0442u0440u0443u043Au0442u043Eu0440
* u0434u043Bu044F u0440u0443u0447u043Du043Eu0439 u0438u043Du0438u0446u0438u0430u043Bu0438u0437u0430u0446u0438u0438
* u0441u0442u0440u043Eu043Au0438 u043Fu043Eu0434u043Au043Bu044Eu0447u0435u043Du0438u044F,
* u043Du0443u0436u0435u043D u0434u043Bu044F u0438u0441u043Fu043Eu043Bu044Cu0437u043Eu0432u0430u043Du0438u044F u0435u0433u043E
* u0432 u043Eu0434u0440u0443u0433u0438u0445 u0444u043Eu0440u043Cu0430u0445
public ConnectionString(string /*
* u0418u043Cu044F u0441u0435u0440u0432u0435u0440u0430 u0431u0430u0437u044B u0434u0430u043Du043Du044Bu0445
InDataSource_Value,
string /*
* u041Du0430u0437u0432u0430u043Du0438u0435 u0431u0430u0437u044B u0434u0430u043Du043Du044Bu0445
InInitialCatalog_Value,
string /*
* u0418u043Cu044F u043Fu043Eu043Bu044Cu0437u043Eu0432u0430u0442u0435u043Bu044F
*/ InUserID_Value,
string /*
* u041Fu0430u0440u043Eu043Bu044C
*/ InPassword_Value)
DataSource_Value = InDataSource_Value;
InitialCatalog_Value = InInitialCatalog_Value;
UserID_Value = InUserID_Value;
Password_Value = InPassword_Value;
* u041Fu043Eu043Bu0443u0447u0438u0442u044C u0438u043Cu044F u0441u0435u0440u0432u0435u0440u0430
* u0431u0430u0437u044B u0434u0430u043Du043Du044Bu0445
public string GetServerName()
return DataSource_Value;
* u041Fu043Eu043Bu0443u0447u0438u0442u044C u043Du0430u0437u0432u0430u043Du0438u0435
* u0431u0430u0437u044B u0434u0430u043Du043Du044Bu0445
public string GetDatabaseName()
return InitialCatalog_Value;
* u041Fu043Eu043Bu0443u0447u0438u0442u044C u0438u043Cu044F
* u0442u0435u043Au0443u0449u0435u0433u043E u043Fu043Eu043Bu044Cu0437u043Eu0432u0430u0442u0435u043Bu044F
public string GetUserName()
return UserID_Value;
* u041Fu043Eu043Bu0443u0447u0438u0442u044C u043Fu0430u0440u043Eu043Bu044C
* u0442u0435u043Au0443u0449u0435u0433u043E u043Fu043Eu043Bu044Cu0437u043Eu0432u0430u0442u0435u043Bu044F
public string GetPassword()
return Password_Value;
* u041Fu0435u0440u0435u0432u043Eu0434 u0441u0442u0440u0443u043Au0442u0443u0440u044B u0432 u0442u0435u043Au0441u0442u043Eu0432u044Bu0439 u0432u0438u0434
* u0434u043Bu044F u0438u0441u043Fu043Eu043Bu044Cu0437u043Eu0432u0430u043Du0438u044F u043Fu0440u0438 u0441u043Eu0437u0434u0430u043Du0438u0438 u043Au043Eu043Du043Du0435u043Au0442u043Eu0440u0430
public override string ToString()
return "Data Source="+DataSource_Value+";Initial Catalog="+
InitialCatalog_Value+";User ID="+UserID_Value+";Password="+
Password_Value;
* u0424u0443u043Du043Au0446u0438u044F u043Fu043Eu043Bu0443u0447u0435u043Du0438u044F u0441u0442u0440u043Eu043Au0438 u043Fu043Eu0434u043Au043Bu044Eu0447u0435u043Du0438u044F u043Fu043E u0443u043Cu043Eu043Bu0447u0430u043Du0438u044E
* u043Du0443u0436u043Du0430 u0431u044Bu043Bu0430 u0434u043Bu044F u0442u0435u0441u0442u043Eu0432
static private string GetDefaultConnectionString()
return "Data Source=BSRV01;Initial Catalog=Prokat_Last;User ID=sa;Password=";
* u0412u043Du0443u0442u0440u0435u043Du043Du044Fu044F u0441u0442u0440u043Eu043Au0430 u043Fu043Eu0434u043Au043Bu044Eu0447u0435u043Du0438u044F
* u043Du0435 u0434u043Eu0441u0442u0443u043Fu043Du0430 u0434u043Bu044F u0432u044Bu0437u043Eu0432u0430 u043Du0430u043Fu0440u044Fu043Cu0443u044E
private ConnectionString localConnectionString;
* u0423u0441u0442u0430u043Du043Eu0432u0438u0442u044C u0441u0442u0440u043Eu043Au0443 u0432u043Du0443u0442u0440u0435u043Du043Du0435u0433u043E u043Fu043Eu0434u043Au043Bu044Eu0447u0435u043Du0438u044F
public void SetConnectionString(ConnectionString CS)
this.localConnectionString = CS;
* u041Fu043Eu043Bu0443u0447u0438u0442u044C u0441u0442u0440u043Eu043Au0443 u0432u043Du0443u0442u0440u0435u043Du043Du0435u0433u043E u043Fu043Eu0434u043Au043Bu044Eu0447u0435u043Du0438u044F
public ConnectionString GetConnectionString()
return this.localConnectionString;
* u0424u0443u043Du043Au0446u0438u044F u0443u0434u0430u043Bu0435u043Du0438u044F u0432u0440u0435u043Cu0435u043Du043Du043Eu0433u043E u0444u0430u0439u043Bu0430
* u043Fu043Eu0441u043Bu0435 u0437u0430u0432u0435u0440u0448u0435u043Du0438u044F u0432u0441u0435u0445 u043Eu043Fu0435u0440u0430u0446u0438u0439 u0441 u0448u0430u0431u043Bu043Eu043Du043Eu043C
private void MainForm_FormClosed(object sender, FormClosedEventArgs e)
if (FileTreeView.Nodes.Count!=0)
if (File.Exists(TemplateFilePath))
File.Delete(TemplateFilePath);
* u041Eu0431u0440u0430u0431u043Eu0442u0447u0438u043A u0434u0432u043Eu0439u043Du043Eu0433u043E u043Au043Bu0438u043Au0430
* u043Fu043E u0448u0430u0431u043Bu043Eu043Du0443 u0432 u0434u0435u0440u0435u0432u0435 u0444u0430u0439u043Bu043Eu0432
public void FileTreeView_DoubleClick(object sender, EventArgs e)
int Result = 0;
try
Result = ParseReportWithDataBase();
if (Result == 0)
Result = ParseReport(TempFilePath + FileTreeView.SelectedNode.Text.ToString() + ".rpt");
if (Result == 0)
Process.Start(TemplateFilePath);
else
MessageBox.Show("u0424u0430u0439u043B u043Du0435 u043Cu043Eu0436u0435u0442 u0431u044Bu0442u044C u043Eu0442u043Au0440u044Bu0442!");
catch (Exception ex)
MessageBox.Show(ex.Message);
* u041Fu043Eu043Bu0443u0447u0435u043Du0438u0435 u0432u0441u0435u0445 u0444u0430u0439u043Bu043Eu0432 u0441 u0440u0430u0441u0448u0438u0440u0435u043Du0438u0435u043C .rpt
* u0438u0437 u0431u0430u0437u044B u043A u043Au043Eu0442u043Eu0440u043Eu0439 u043Fu0440u0438u0441u043Eu0435u0434u0438u043Du0438u043Bu0438u0441u044C
public void GetReportNamesFromDataBase(ConnectionString CS)
try
SqlConnection C = new SqlConnection(CS.ToString());
SqlDataAdapter adapter = new SqlDataAdapter();
DataTable table = new DataTable();
table.Clear();
string sqlcom = "Select P115 from " + GetDataViewName(CS,"24") + " where P116 like '%.rpt'";
SqlCommand Q1 = new SqlCommand(sqlcom,C);
Q1.CommandType = CommandType.Text;
adapter.SelectCommand = Q1;
adapter.Fill(table);
FileTreeView.Nodes.Clear();
for (int i = 0; i < table.Rows.Count; i++)
FileTreeView.Nodes.Add(table.Rows<i>.ItemArray.GetValue(
table.Rows<i>.ItemArray.Length-1).ToString());
// MessageBox.Show(table.Rows<i>.ItemArray.GetValue(0).ToString());
C.Close();
catch (Exception ex)
MessageBox.Show(ex.Message);
* u041Fu043Eu043Bu0443u0447u0438u0442u044C u0438u043Cu044F DataView
* u0434u043Bu044F u0442u0435u043Au0443u0449u0435u0433u043E u043Fu043Eu043Bu044Cu0437u043Eu0432u0430u0442u0435u043Bu044F
private string GetDataViewName(ConnectionString CS,string ClassID)
string ViewName = "";
SqlConnection C = new SqlConnection(CS.ToString());
C.Open();
SqlCommand Q = new SqlCommand("[dbo].[_SysGetClassesInfoNew1]"/*P115 from dbo.Attr24 where P116='.rpt'*/, C);
Q.CommandType = CommandType.Text;
SqlDataAdapter adapter = new SqlDataAdapter();
adapter.SelectCommand = Q;
DataTable table = new DataTable();
adapter.Fill(table);
for (int i = 0; i < table.Rows.Count; i++)
if (table.Rows<i>.ItemArray.GetValue(0).ToString() == ClassID)
ViewName = table.Rows<i>.ItemArray.GetValue(13).ToString();
// MessageBox.Show(ViewName);
C.Close();
return ViewName;
* u041Eu0431u0440u0430u0431u043Eu0442u0447u0438u043A u043Au043Bu0438u043Au0430 u043Du0430 u0432u044Bu043Fu0430u0434u0430u044Eu0449u0435u043C
* u043Cu0435u043Du044E u0432 u043Fu0443u043Du043Au0442u0435 "Delete"
private void deleteToolStripMenuItem_Click(object sender, EventArgs e)
FileTreeView.SelectedNode.Remove(); -
Udf Data is not being displayed in the report
Hi all,
i have designed one report in which i am displaying some udf fields along with other system fields.
i have not used any selection criteria.
when i run report it doesn't display udf data of some random rows in the report even if data is peresent in that udf field.
If i open sales order and press 'Shift-F2' and update the document and now if i run report then i get that udf value in the report.
why this happening. data is there in the udf field only its not displayed in the report with out updating the that udf.
pls suggest some solution.
regsrds,
Chetan.Hi Ashish,
I ran the "ZPS/!ZPS" in RSRT where ZPS is the infoset name. In Dev, it displayed the values. In QA, it displayed the below messages:
ECharacteristic 0TCAKYFNM does not exist. Check authorizations
WThere are calculated elements. These results are bracketed [ ]
and below that, it displayed the values for Number of records. But, it has not displayed the values for the other figures.
Does this has any impact in QA.
Thanks & Regards,
AVN Rao. -
Closing the report browser?
Hi All,
I am using developer suit 10g, I am generating a pdf file on the application server but after the file generated the browser open and give me a message "Oracle Reports Job Status Successfully run ".
I need to hide the browser because I am generating using loop so it opens the browser alot of times.
Thanks,How do you invoke the report? Using forms?
-
How can I will declare the symbol u2018 (Single Quote) in the report
Hi ,
Could you please tell me how can I will declare the symbol u2018 (Single Quote) in the report.
My requirement is that I have concate the data with single quote and after that I have to store the data in to an internal table and I have to download the data in the form text file in the presentation server.
For example :
Let the below data I want to download into the presentation serve in the format of text file by storing in internal table.
Assume all are constants:
1st line : abcu2019add
2nd line : defu2019gef
Thanks in advance.Hi Jyothi,
Thanks for the quick reply .
I can agree with you are point but My requirement is like this I am explaining clearly.
I have declared the internal table like this.
DATA: BEGIN OF OTAB OCCURS 0,
LINE (9024),
END OF OTAB.
So I have to append the each line item into the internal table.
So I am explaining what the data I have to append
Ist line contains
'UNBUNOC:2020308u2019 where 020308 I will get the date from reguh table
2nd line contains:
'DTM+20020510' where the 20020510 will be reference document number from the table reguh.
So I want to declare a constant 'UNBUNOC:2
2nd the date from reguh table
And another constant u2018
So that I can concate all the three and I can put into string and I will append into internal table and I can download the data into the presentation server.
Please let me know if you need any more clarification regarding my requirement.
Thanks in advance. -
Print Quote the report is in PDF but need to be new RTF template
We have 11.5.10 apps, the Quote screen is an OAF screen.
When clicking Print Quote the report is in PDF, They want to include a new RTF template for printing instead of PDF.
The new RTF template is created. But what I do not know is how the quote screen will take the new template. I can use XMLP to upload the RTF template but that may not be sufficient to make it appear in the Quote screen.
I am looking at the profile ASO:Default Layout Template. Am I headed the right way?Hi,
Please refer to the following documents, it should be helpful.
Note: 780722.1 - How to Create a Custom Print Quote Template in Oracle Quoting ?
https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=780722.1
Note: 392728.1 - How to Modify the data source for the XML version of the Print Quote report
https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=392728.1
Note: 468982.1 - How To Customize The Asoprint.Xsl
https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=468982.1
Regards,
Hussein -
Print the report after see it on screen
Hi,
I4d like to know if someone could tell me how to do the following:
I have a report on screen and I want to have the oportunity to choose, after see it, if I want to print it or not, so I4ve thought about a button on the screen which allows me to do this but... how can I do this? Appart of that where I should set the position where the values want to be printed in the paper?
VeroVeronica,
Doesn't the menuitem File->Print do this for you? I don't understand what you mean about where the values get printed on paper. Can you be more specific about where you are viewing the report (Report Runtime Previewer, browser, etc.)?
regards,
Stewart -
Print the report on page has width larger than height and not landscape mode
Hi,
I'm trying to print report on page (Width: 18cm, Height: 13cm) which the width larger than the height.
The problem is windows keeps changing the page oreintation to landscape and when I change it back to portrait its changing the width to 13cm and height to 18cm.
I'm using dot matrix printer to print the report, if i put Landscape , printer is printing the text in horizontal.
Already i have tried to setup the custom for on printer, and used custom page size but it is changing to landscape.
I need to print the report with out preview, direct print top printer, NO PDF....
Thank you .....Hi Anil,
After testing the issue in my environment, I can reproduce it. When I set (Width: 18cm, Height: 13cm) as the Report Page size, it would automatically convert Orientation from Portrait to Landscape. Because the Orientation displayed is dependent on the page
width and page height of the report.
But in my scenario, the Orientation option just change the Width and Height sizes, it couldn’t affect the text rotation. I guess this issue can be caused by the printer and printer driver, please try to update them. Reference:
http://stackoverflow.com/questions/15244336/printing-in-landscape-or-portrait-automatically-rotates-text-ssrs?lq=1
Hope this helps.
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
Not Able to Generate Out of the Report by adding the new 2 fields
Hi,
I'm Very new to ABAP. I have created one report. after 2 new fields added they are EKNAM and EKGRP.
The Thing is the remaining fields are displaying in the output. The Newly added fields are not displaying the out. I was able to add this 2 fields in the head of the report. But issue is not able to get the data on these 2 fields.
Please see the below program and any one please help me out to display the data in this report for the fields eknam and ekgrp.
TABLES: eban,
lfa1,
ekko,
t024,
v_username.
DATA: BEGIN OF i_req_items OCCURS 10,
ernam LIKE eban-ernam, "Created by
lifnr LIKE eban-lifnr, "Desired vendor
ebeln LIKE eban-ebeln, "PO Number
ebelp LIKE eban-ebelp, "PO Item
eknam LIKE t024-eknam, "Pur.Grp Name
ekgrp LIKE t024-ekgrp, "Pur.Grp Number
flief LIKE eban-flief, "Fixed vendor
name1 LIKE lfa1-name1, "Vendor name
badat LIKE eban-badat, "Creation date
erdat LIKE eban-erdat, "Change date
banfn LIKE eban-banfn, "Requisition no.
bnfpo LIKE eban-bnfpo, "Req. item no.
bsart LIKE eban-bsart, "Document type
knttp LIKE eban-knttp, "Acct.assgmt category
txz01 LIKE eban-txz01, "PO item description
menge LIKE eban-menge, "Quantity
preis LIKE eban-preis, "Price
peinh LIKE eban-peinh, "Price unit
value(14) TYPE p DECIMALS 2, "Item Value
END OF i_req_items.
DATA: BEGIN OF i_reqs OCCURS 10,
ernam LIKE eban-ernam, "Created by
persn LIKE usr21-persnumber, "Person number
uname LIKE adrp-name_text, "User name
lifnr LIKE eban-lifnr, "Vendor
name1 LIKE lfa1-name1, "Vendor name
badat LIKE eban-badat, "Creation date
banfn LIKE eban-banfn, "Requisition no.
bnfpo LIKE eban-bnfpo, "Req. item no.
bsart LIKE eban-bsart, "Document type
knttp LIKE eban-knttp, "Acct.assgmt category
txz01 LIKE eban-txz01, "PO item description
eknam like t024-eknam, "Purchase Grp Name
ekgrp like t024-ekgrp, "Purchase Grp Number
value(14) TYPE p DECIMALS 2, "Item Value
END OF i_reqs.
DATA: BEGIN OF i_req_keys OCCURS 0,
ernam LIKE eban-ernam, "Created by
lifnr LIKE eban-lifnr, "Desired vendor
erdat LIKE eban-erdat, "Create or Change date
banfn LIKE eban-banfn, "Requisition no.
bnfpo LIKE eban-bnfpo, "Req. item no.
eknam like t024-eknam, "Purchase Grp Name
ekgrp like t024-ekgrp, "Purchase Grp number
END OF i_req_keys.
DATA: BEGIN OF i_req_keeper OCCURS 0,
ernam LIKE eban-ernam, "Created by
lifnr LIKE eban-lifnr, "Desired vendor
banfn LIKE eban-banfn, "Requisition no
END OF i_req_keeper.
DATA: wa_reqitems LIKE i_req_items.
DATA: BEGIN OF i_export OCCURS 10,
record(150) TYPE c,
END OF i_export.
CONSTANTS
CONSTANTS:
c_doccat LIKE eban-bstyp VALUE 'B',
c_creind LIKE eban-estkz VALUE 'R',
c_delflag LIKE eban-loekz VALUE 'L',
c_write(5) TYPE c VALUE 'WRITE',
c_slash(1) TYPE c VALUE '/',
*start ESPZC U8DK900439
c_delimiter TYPE x VALUE '09',
c_delimiter TYPE c VALUE cl_abap_char_utilities=>horizontal_tab,
*end ESPZC U8DK900439
c_sc(1) TYPE c VALUE ';',
c_x(1) TYPE c VALUE 'X',
c_usd(1) TYPE c VALUE '2',
c_export LIKE authb-filename VALUE '/BAY2/UBEM_SPLIT_REQS'.
WORKING VARIABLES
DATA: w_report_id LIKE syst-repid,
w_sttime LIKE syst-uzeit,
w_rpt_pagno LIKE syst-pagno,
w_rc LIKE sy-subrc,
w_datelow LIKE eban-badat,
w_datehigh LIKE eban-badat,
w_export LIKE c_export,
w_records TYPE i,
w_message(50) TYPE c.
TYPES number TYPE i.
SELECTION SCREEN / PARAMETERS
SELECTION-SCREEN BEGIN OF BLOCK org WITH FRAME TITLE text-001.
PARAMETERS: p_purorg LIKE eban-ekorg OBLIGATORY DEFAULT 'US02'.
SELECT-OPTIONS: s_doctyp FOR eban-bsart,
s_date FOR eban-badat.
PARAMETERS: p_timper(2) TYPE n.
SELECTION-SCREEN: COMMENT 37(37) text-002.
SELECTION-SCREEN END OF BLOCK org.
SELECTION-SCREEN BEGIN OF BLOCK outp WITH FRAME TITLE text-003.
PARAMETERS: p_onlin RADIOBUTTON GROUP outp DEFAULT 'X',
p_servr RADIOBUTTON GROUP outp.
SELECTION-SCREEN END OF BLOCK outp.
AT SELECTION SCREEN
AT SELECTION-SCREEN.
IF p_servr = c_x.
CLEAR w_rc.
PERFORM authority_check_dataset USING w_export
CHANGING w_rc.
IF w_rc <> 0.
MESSAGE e532 WITH text-006 w_export.
ENDIF.
CLEAR w_rc.
PERFORM verify_unix_path_and_file CHANGING w_rc.
IF w_rc <> 0.
MESSAGE e531 WITH w_message.
ENDIF.
ENDIF.
INITIALIZATION EVENT
INITIALIZATION.
PERFORM get_filename.
MOVE syst-uzeit TO w_sttime.
MOVE syst-repid TO w_report_id.
CLEAR: w_rpt_pagno.
START-OF-SELECTION.
PERFORM get_data.
IF p_onlin = c_x.
IF w_records GT 0.
PERFORM print_report_header.
PERFORM write_report.
ELSE.
MESSAGE i531 WITH text-007.
ENDIF.
ELSEIF p_servr = c_x.
PERFORM write_export.
ENDIF.
END-OF-SELECTION.
---- F O R M R O U T I N E S -
*& FORM get_filename
FORM get_filename.
CALL FUNCTION 'FILE_GET_NAME'
EXPORTING
logical_filename = c_export
IMPORTING
file_name = w_export
EXCEPTIONS
file_not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
ENDFORM. " get_filename
FORM authority_check_dataset
FORM authority_check_dataset USING p_filename
CHANGING p_rc.
CALL FUNCTION 'AUTHORITY_CHECK_DATASET'
EXPORTING
activity = c_write
filename = p_filename
EXCEPTIONS
no_authority = 1
activity_unknown = 2
OTHERS = 3.
p_rc = sy-subrc.
ENDFORM. "authority_check_dataset
FORM verify_unix_path_and_file
FORM verify_unix_path_and_file CHANGING p_rc.
*start ESPZC U8DK900439
OPEN DATASET w_export FOR OUTPUT IN TEXT MODE
MESSAGE w_message.
OPEN DATASET w_export FOR OUTPUT IN TEXT MODE ENCODING DEFAULT
MESSAGE w_message.
*end ESPZC U8DK900439
p_rc = sy-subrc.
ENDFORM. "verify_unix_path_and_file
FORM get_data
FORM get_data.
CLEAR w_datelow.
CLEAR w_datehigh.
w_datelow = s_date-low - p_timper.
w_datehigh = s_date-high + p_timper.
w_datehigh = s_date-high.
SELECT ernam lifnr ebeln ebelp flief badat erdat banfn bnfpo bsart
knttp menge preis peinh txz01
FROM eban
INTO CORRESPONDING FIELDS OF TABLE i_req_items
WHERE bstyp = c_doccat
AND estkz = c_creind
AND knttp <> space
AND bsart IN s_doctyp
AND loekz <> c_delflag
AND ekorg EQ p_purorg
AND ( ( badat BETWEEN w_datelow and w_datehigh ) OR
( erdat BETWEEN w_datelow AND w_datehigh ) ).
AND erdat BETWEEN w_datelow AND w_datehigh.
IF sy-subrc = 0.
LOOP AT i_req_items.
IF i_req_items-lifnr IS INITIAL.
IF NOT i_req_items-flief IS INITIAL.
MOVE i_req_items-flief TO i_req_items-lifnr.
MODIFY i_req_items.
ENDIF.
IF NOT i_req_items-ebeln IS INITIAL.
SELECT lifnr FROM ekko
INTO i_req_items-lifnr
WHERE ebeln = i_req_items-ebeln.
ENDSELECT.
MODIFY i_req_items.
ENDIF.
ENDIF.
IF i_req_items-erdat GT i_req_items-badat.
MOVE i_req_items-erdat TO i_req_items-badat.
MODIFY i_req_items.
ENDIF.
ENDLOOP.
PERFORM weed_out_unique_records.
PERFORM apply_time_period.
SORT i_req_items BY ernam lifnr banfn bnfpo.
LOOP AT i_req_items.
i_req_items-value = ( i_req_items-menge *
( i_req_items-preis / i_req_items-peinh ) ).
MODIFY i_req_items.
ENDLOOP.
Getting vendor name from table LFA1 -
CLEAR i_req_items.
LOOP AT i_req_items.
SELECT SINGLE name1 FROM lfa1
INTO i_req_items-name1
WHERE lifnr = i_req_items-lifnr.
MODIFY i_req_items.
ENDLOOP.
LOOP AT i_req_items.
MOVE-CORRESPONDING i_req_items TO i_reqs.
Getting user name from view v_username -
SELECT SINGLE name_text
FROM v_username INTO i_reqs-uname
WHERE bname = i_reqs-ernam.
APPEND i_reqs.
ENDLOOP.
ENDIF.
DESCRIBE TABLE i_reqs LINES w_records.
ENDFORM. "Get_data
FORM print_report_header
FORM print_report_header.
ADD 1 TO w_rpt_pagno.
CALL FUNCTION '/BAY2/UBEXBH_BAYER_HEADR_FUN'
EXPORTING
f_jobname = text-020
f_business_group = text-021
f_report_title = text-022
f_repid = w_report_id
f_sysid = syst-sysid
f_linsz = syst-linsz
f_pagno = w_rpt_pagno
f_mandt = syst-mandt
f_datum = syst-datum
f_uzeit = w_sttime.
FORMAT COLOR COL_HEADING.
WRITE: /1 text-010, "Created by CWID & user name
29 text-011, "Vendor #
38 text-012, "Vendor Name
69 text-013, "Req Number
79 text-014, "/Item
87 text-015, "Created On
98 text-017, "A (AcctAssgmtCat)
100(14) text-019 RIGHT-JUSTIFIED, "Item Value
116(30) text-018, "Item Description
148 text-030, "Pur.Grp Name
170 text-031. "Pur.Grp Number
FORMAT COLOR OFF.
ULINE.
ENDFORM. "print_report_header
*& Form WRITE_REPORT
FORM write_report.
LOOP AT i_reqs.
WRITE: /1 i_reqs-ernam,
9(18) i_reqs-uname,
29 i_reqs-lifnr,
38(30) i_reqs-name1,
69 i_reqs-banfn,
79 c_slash,
80 i_reqs-bnfpo,
87 i_reqs-badat,
98 i_reqs-knttp,
100(14) i_reqs-value CURRENCY c_usd,
116(30) i_reqs-txz01,
145 i_reqs-eknam,
160 i_reqs-ekgrp.
ENDLOOP.
ENDFORM. "write_report
*& Form WRITE_EXPORT
FORM write_export.
DATA: l_value(14) TYPE c,
l_bsart(100) TYPE c,
l_uname(7) TYPE c,
l_records(5) TYPE c,
l_header(150) TYPE c,
l_params(150) TYPE c,
i_char TYPE i.
LOOP AT i_reqs.
CLEAR l_value.
CLEAR l_uname.
l_value = i_reqs-value.
l_uname = sy-uname.
CONCATENATE: i_reqs-uname
i_reqs-ernam
i_reqs-lifnr
i_reqs-name1
i_reqs-banfn
i_reqs-bnfpo
i_reqs-badat
i_reqs-knttp
l_value
i_reqs-txz01 INTO i_export
SEPARATED BY c_delimiter.
APPEND i_export.
ENDLOOP.
CONCATENATE: text-008 "Created By Name
text-009 "CWID
text-011 "Vendor No
text-012 "Vendor Name
text-013 "Req Number
text-023 "Item
text-015 "Created On
text-017 "A
text-019 "Item Value
text-018 "Item Description
text-030 "Purchase Grp name
text-031 "Purchase Grp number
INTO l_header SEPARATED BY c_delimiter.
INSERT l_header INTO i_export INDEX 1.
IF sy-batch IS INITIAL.
MOVE sy-uname TO l_uname.
ELSE.
MOVE text-024 TO l_uname.
ENDIF.
PERFORM collect_bsart CHANGING l_bsart
i_char.
l_records = w_records.
CONCATENATE: sy-sysid
p_purorg
l_bsart(i_char)
s_date-low
s_date-high
p_timper
l_uname
sy-datum
l_records INTO l_params
SEPARATED BY c_delimiter.
INSERT l_params INTO i_export INDEX 1.
LOOP AT i_export.
CONDENSE i_export NO-GAPS.
TRANSFER i_export TO w_export.
ENDLOOP.
CLOSE DATASET w_export.
MESSAGE s533 WITH text-028 w_export text-029.
ENDFORM. "write_export
*& FORM collect_bsart
FORM collect_bsart CHANGING p_bsart
p_char.
CLEAR p_bsart.
LOOP AT s_doctyp.
IF sy-tabix = 1.
p_bsart = s_doctyp-low.
ELSE.
CONCATENATE: p_bsart c_sc s_doctyp-low INTO p_bsart.
ENDIF.
ENDLOOP.
CONDENSE p_bsart NO-GAPS.
p_char = strlen( p_bsart ).
ENDFORM. "collect_bsart
*& Form WEED_OUT_UNIQUE_RECORDS
FORM weed_out_unique_records.
DATA: i_l_req_items LIKE i_req_items OCCURS 0 WITH HEADER LINE.
DATA: i_l_req_final_items LIKE i_req_items OCCURS 0 WITH HEADER LINE.
DATA: l_count TYPE i,
l_sy_tabix LIKE sy-tabix,
l_banfn LIKE eban-banfn.
REFRESH i_l_req_items.
REFRESH i_l_req_final_items.
CLEAR l_banfn.
i_l_req_items[] = i_req_items[].
i_l_req_final_items[] = i_req_items[].
SORT i_req_items BY ernam lifnr.
SORT i_l_req_items BY ernam lifnr.
SORT i_l_req_final_items BY ernam lifnr.
LOOP AT i_l_req_items.
l_banfn = i_l_req_items-banfn.
CLEAR l_count.
LOOP AT i_req_items
WHERE ernam = i_l_req_items-ernam
AND lifnr = i_l_req_items-lifnr.
IF i_req_items-banfn <> l_banfn.
ADD +1 TO l_count.
ENDIF.
ENDLOOP.
IF NOT ( l_count > 0 ).
LOOP AT i_l_req_final_items
WHERE ernam = i_l_req_items-ernam
AND lifnr = i_l_req_items-lifnr.
DELETE i_l_req_final_items.
ENDLOOP.
ENDIF.
ENDLOOP.
REFRESH i_req_items.
i_req_items[] = i_l_req_final_items[].
ENDFORM. " WEED_OUT_UNIQUE_RECORDS
*& Form APPLY_TIME_PERIOD
FORM apply_time_period.
DATA: l_i_req_keys LIKE i_req_keys.
DATA: l_days_diff TYPE p,
l_no_of_key_recs TYPE i,
l_next_item LIKE sy-tabix,
l_finished_with_keys TYPE c VALUE 'N',
l_add_line TYPE c VALUE 'N',
l_count TYPE i,
l_req_ernam LIKE eban-ernam,
l_req_lifnr LIKE lfa1-lifnr,
l_req_banfn LIKE eban-banfn,
l_save_tabix like sy-tabix.
REFRESH: i_req_keys, i_req_keeper.
LOOP AT i_req_items.
MOVE-CORRESPONDING i_req_items TO
i_req_keys.
IF i_req_items-erdat IS INITIAL.
i_req_keys-erdat = i_req_items-badat.
ENDIF.
APPEND i_req_keys.
ENDLOOP.
SORT i_req_keys BY ernam lifnr erdat.
CLEAR l_no_of_key_recs.
DESCRIBE TABLE i_req_keys LINES l_no_of_key_recs.
LOOP AT i_req_keys.
IF l_add_line = 'Y'.
MOVE-CORRESPONDING i_req_keys
TO i_req_keeper.
APPEND i_req_keeper.
l_add_line = 'N'.
ENDIF.
IF l_finished_with_keys = 'Y'.
EXIT.
ENDIF.
CLEAR l_next_item.
l_save_tabix = sy-tabix.
COMPUTE l_next_item = sy-tabix + 1.
IF l_next_item = l_no_of_key_recs.
l_finished_with_keys = 'Y'.
ENDIF.
clear: l_i_req_keys.
READ TABLE i_req_keys INDEX l_next_item
INTO l_i_req_keys.
sy-tabix = l_save_tabix.
CLEAR l_days_diff.
l_days_diff = l_i_req_keys-erdat -
i_req_keys-erdat.
IF l_i_req_keys-ernam =
i_req_keys-ernam AND
l_i_req_keys-lifnr =
i_req_keys-lifnr AND
l_i_req_keys-banfn <>
i_req_keys-banfn AND
l_days_diff <= p_timper.
MOVE-CORRESPONDING i_req_keys
TO i_req_keeper.
APPEND i_req_keeper.
l_add_line = 'Y'.
ENDIF.
ENDLOOP.
DELETE ADJACENT DUPLICATES FROM i_req_keeper
COMPARING ALL FIELDS.
SORT i_req_keeper BY ernam lifnr banfn.
LOOP AT i_req_items.
CLEAR l_count.
CLEAR: l_req_ernam,
l_req_lifnr,
l_req_banfn.
l_req_ernam = i_req_items-ernam.
l_req_lifnr = i_req_items-lifnr.
l_req_banfn = i_req_items-banfn.
LOOP AT i_req_keeper
WHERE ernam = i_req_items-ernam
AND lifnr = i_req_items-lifnr
AND banfn = i_req_items-banfn.
ADD +1 TO l_count.
ENDLOOP.
IF NOT ( l_count > 0 ).
LOOP AT i_req_items
WHERE ernam = l_req_ernam
AND lifnr = l_req_lifnr
AND banfn = l_req_banfn.
DELETE i_req_items.
ENDLOOP.
ENDIF.
ENDLOOP.
ENDFORM. " APPLY_TIME_PERIODRajesh,
Put a breakpoint and try to debug the report step by step.
You will findout the reason very easily.
Whenever you have a select and are trying to append into an internal table, keep checking your internal table if it is been populated with the correct records.
This way, you will findout the cause and can correct is accordingly.
Thanks,
Suresh Ganti -
"Failed to open the connection" problem related to multiple tables in the report?
Post Author: Gadow
CA Forum: Data Connectivity and SQL
System specifics:
Web environment using ASP.Net 2.0 (from Visual Studio 2005 Professional)
Crystal Reports 2008, v. 12.0.0.549, Full
We have set up the following method for displaying reports via our website:
User is sent to a report-specific page. The user is given some filtering options specific to the report that will be viewed. When the user has specified the data filters, the user clicks a button.
The page wraps up the report parameters -- selection query, formula values, report location, the name to be displayed, etc. -- into a class which gets put into the Session object.
The page redirects to DisplayReport.aspx. ALL reports redirect to this page.
DisplayReport.aspx retrieves the report parameters from Session. A ReportDocument object is created and loaded, then set with the data from the parameters class.
A ConnectionInfo object is created and set with the relevant log on credentials. All of the reports draw from the same database, so the connection information is hard-coded as the same for all reports. The page then iterates through all of the tables in the Database.Tables collection of the ReportDocument and calls ApplyLogOnInfo to each table using the ConnectionInfo object.
The page is rendered and the user gets the filtered report.
We currently have seven reports. Five reports work fine and display the correctly filtered data with no error messages. Two reports generate a Failed to open the connection error and do not display. I have verified that the queries being sent to DisplayReport.aspx are valid, and as I said the connection information itself is hard-coded in the one page that displays the reports and this is identical to all reports.
The five reports that do work all have a single data table, either an actual database table or a single view. The two reports that do not work all have multiple tables. As far as I can tell, this is the only difference between the sets; all seven reports are based on the same DSN and I have verified the database on all of the reports. All of the reports were written using Crystal Reports 8, and all of the reports display fine in a Windows app I wrote some years ago using Crystal Reports 8. Again, the only difference between those reports that do work and those that do not is the number of tables used in the report: one table or view in the reports that display, more than one table (tables only, none use views) in the reports that do not display.
As for the code I am using, below are the relevant methods. The function MakeConnectionInfo simply parses out the components of a standard SQL connection string into a ConnectionInfo object. DisplayedReport is the ID of the CrystalReportViewer on the page.Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs)
Dim o As Object = Session("ReportParams")
Dim ReportURL As String = ""
'Verify that there is a ReportParameters object
If o Is Nothing OrElse o.GetType IsNot GetType(ReportParameters) Then 'Redirect to the error page
Response.Redirect("/errors/MissingReport.aspx")
End If
ReportParams = CType(o, ReportParameters)
'Verify that the report exists
ReportURL = "/Reports/ReportFiles/" + ReportParams.ReportName
ReportPath = Server.MapPath(ReportURL)
If Not File.Exists(ReportPath) Then
Response.Redirect("/errors/MissingReport.aspx?Report=" + ReportParams.ReportTitle)
End If
InitializeReport()
End Sub
Protected Sub InitializeReport()
Dim RD As New ReportDocument
Dim CI As ConnectionInfo = MakeConnectionInfo(DB_Bonus)
Dim RPF As CrystalDecisions.Shared.ParameterField = Nothing
RD.Load(ReportPath)
If ReportParams.SelectString <> "" Then
Dim Adapt As New SqlDataAdapter(ReportParams.SelectString, DB_Bonus)
Dim DS As New Data.DataSet
Adapt.Fill(DS)
RD.SetDataSource(DS.Tables(0))
End If
For Each kvp As KeyValuePair(Of String, String) In ReportParams.Formulas
Dim FFD As FormulaFieldDefinition = Nothing
Try
FFD = RD.DataDefinition.FormulaFields(kvp.Key)
Catch ex As Exception
'Do nothing
End Try
If FFD IsNot Nothing Then
Select Case FFD.ValueType
Case FieldValueType.DateField, FieldValueType.DateTimeField
If IsDate(kvp.Value) Then
FFD.Text = String.Format("Date()", Convert.ToDateTime(kvp.Value).ToString("yyyy, MM, dd"))
Else
FFD.Text = "Date(1960, 01, 01)"
End If
Case FieldValueType.StringField
FFD.Text = String.Format("""""", kvp.Value)
Case Else
'For now, treat these as if they were strings. If things blow up here,
'we will need to add the appropriate formatting for the field type.
FFD.Text = String.Format("""""", kvp.Value)
End Select
End If
Next
For Each T As CrystalDecisions.CrystalReports.Engine.Table In RD.Database.Tables
Dim TLI As TableLogOnInfo = T.LogOnInfo
TLI.ConnectionInfo = CI
T.ApplyLogOnInfo(TLI)
Next
DisplayedReport.ReportSource = RD
End Sub
Does this approach not work with reports containing multiple tables, or is there something I'm missing? Any meaningful suggestions would be much appreciated.Dear Dixit,
Please refer to the Crystal report landing page to get the details
information about the support for crystal report issues.
Please use the following thread to post your questions related to
crystal report.
SAP Business One and Crystal Reports
Regards,
Rakesh Pati
SAP Business One Forum Team. -
Stop the report from firing until the user clicks the Go button?
Hi All,
Is there a way to stop the report from firing until the user clicks the Go button? At the moment it is populating when I open the dashboard page. I found something online that said i could use the Page Options>Save Current Settings> For Others.. but even though i am signed in as an administrator i only see a For Me.. option. Also, even after setting this option i would like to be able to hit the 'Go' button to run the report and have it uncollapse the section. Is this possible?
ThanksThanks for the replies,
In my report i am trying to constrain the report to todays data only. However the only prompt i have is for another column. If i place a filter on the date column with Year=0000 it will not change with the prompt selection and so will never return any results. Is there any other way?
It seems wasteful to fire a request to the database onload of the page. Is there an option to only fire a request what the prompts are entered? I will be using a stored proc which needs parameters to run the request so it would be good to be able to set the report to not run until it has parameters entered
Thanks -
Question
I am not able to launch FF everytime i try to open it, it says FF has to submit a crash report,and restore yr tabs. I even tried doing that and the report was submitted too, but still FF did not start, and the problem still persists, please help me solve this issue
'''(in English)'''Hi Danny,
Per my understanding that you can't get the expect result by using the expression "=Count(Fields!TICKET_STATUS.Value=4) " to count the the TICKET_STATUS which value is 4, the result will returns the count of all the TICKET_STATUS values(206)
but not 180, right?
I have tested on my local environment and can reproduce the issue, the issue caused by you are using the count() function in the incorrect way, please modify the expression as below and have a test:
=COUNT(IIF(Fields!TICKET_STATUS.Value=4 ,1,Nothing))
or
=SUM(IIF(Fields!TICKET_STATUS=4,1,0))
If you still have any problem, please feel free to ask.
Regards,
Vicky Liu
Vicky Liu
TechNet Community Support -
Hello All,
I have a report page with some search item.When I print the page the title does not appear on the output page.
How I can print the report and its title on the output page.
any quick help pleaseHi Mohammad
I allow users to download reports using the Interactive Reports Region.
If you use that method then you can insert a title at the top of the report by populating the Report Region > Print Attributes (TAB) > Page Header
Note: This is available when using APEX coupled with Oracle Business Intelligence Publisher. It does not work with "CSV" output.
Kind regards
Simon Gadd -
Hi to all,
I'm using Asp.Net 2.0-C#, Crystal Report 11 SP1.
I bind some records to the report, i want to print the report when a checkbox is clicked instead of CR Print button, how to do this, experts please post any code?Hello,
I posted hyperlinks to the [Developer Library|https://www.sdn.sap.com/irj/sdn/businessobjects-sdklibrary], and the [Crystal Reports .NET SDK Guide|http://devlibrary.businessobjects.com/BusinessObjectsXIR2SP2/en/devsuite.htm] for CR XI R2.
From the main Developer Library page scroll down the page to the [XI|http://devlibrary.businessobjects.com/BusinessObjectsXI/en/devlib.htm] (v11.0) and the [XI R2|http://devlibrary.businessobjects.com/BusinessObjectsXIR2SP2/en/devsuite.htm] (v11.5) versions of the Crystal Reports .NET SDK Guide.
Click on one of the above links to choose the version of the Dev Library you'd like to explore. After it loads you'll see Content and Search buttons in the left hand pane. Click on Search and search for PrintToPrinter. In the results list you'll see the PrintToPrinter method. Click on this and you'll see the information you're looking for.
Please start using the above links to search for your answers - the information is there.
Sincerely,
Dan Kelleher -
How can i display all the Coloumns (Key Figures) in the Report's same page
Hi All,
I am currently working on the BI 7.0 reporting. In the BEx Query Designer report, I am having 13 coloumns (7 Key figures and 6 Formulas) in the report. It is now displaying 10 coloumns in the First page of report. The other 3 coloumns can be seen by clicking on the next page. But the requirement is to see coloumns in the SAME PAGE.
Are there any settings OR any other thing in the Query Designer, which can enable me to see all the coloumns on SAME page. The users are not interested in scrolling next page for 3 coloumns.
Appreciates the Quick help/Response, please.
Regards
RamanaIn Web Application Designer, for the properties of your analysis webitem under the Paging category, change parameter 'Number of Data Columns Displayed at Once' (BLOCK_COLUMNS_SIZE) to 0. This will make all columns show instead of paginating as it is doing now.
Maybe you are looking for
-
Hi Apple Team, my iphone can't share bluetooth files with my macbook pro. But other devices can share bluetooth files with my mac book pro. Please, kindly open up bluetooth to accept all connections from all devices. Now it difficult for me to share
-
Deleting files which are offline.
What is the best way to get Lightroom to delete files which are offline? I don't use lightroom as a database or DAM - for that i use iMatch. I use lightroom only to process the raws and hate to see the thumb files with a question mark on them when th
-
Is there a way to bypass user login as its not being recognised
I have disabled automatic login and now I can't login as it does not like the username an or password, is there a way to bypass the user login, please help ASAP
-
Re: Syncing a synth to Logic
Hi all, I have the micro korg syth, been trying to figure out how to synch it so that 1. I can write midi into logic and have it play on the micro korg. 2. I can have the delay and arpeggiator (and other time based effects) will synch to my project t
-
JavaFX with iPad and other Tablets...
Hi, can i run JavaFX code on iPad4 and iPhone ?? on other tablets like Nexus - Galaxy ... How can i make programming on iPad -iPhone using Java and JavaFX ?? it seems that no intersection between iPadiPhone and Java ..? Really ?? Many thanks