Customize parameter in SQL report
I'm testing some possibilities in SAP B1 and B1UP.
I have this code behind an added button on the Item Master Data window:
select t0.itemcode,t0.itmsgrpcod as ItemGroup
from dbo.oitm t0
where t0.itmsgrpcod = [%0]
Sorry, the variable should be between [ ] but it is automatically converted to a link here.
The pop-up window for the user input asks a value for "Variable 0".
Can this prompt be customized as well as the text in the pop-up's title bar?
Something else that would come handy: Can it be made to show a selection box with the available choices for ItmsGrpCod?
Thanks for any help.
Hey Daniel!
I've tried your solution in the SAP query designer. It doesn't work for me.
This works fine:
declare @ItGrp smallint
set @ItGrp = 199
select t0.ItemCode, t0.itmsgrpcod as ItemGroup
from dbo.oitm t0
where t0.itmsgrpcod = @ItGrp
When I replace 199 by
'[%0]'
then I get no pop-up window for the parameter and errors (in the red bar at the bottom):
1) First time when loading the qry: Document (RDOC)
2) Then repeatedly on the Execute button:
u2022 Service Contracts (OCTR) or
u2022 User-Defined Values (CSHS)
Very strange behaviour.
Something wrong with our SAP installation?
Similar Messages
-
Passing parameter in sql reports
Hi all,
I created a sql file to generate a sql*report, in which i am passing a parameter and i stored it in the respective top.
I created a executable, program in which i passed the parameter as usual.
But while i submitted the request, it is not getting completed.
please help
--regards
--RajDo you spool the output to a File?
If you do, then maybe the filename you are using is locked for some reason. Try using a different file name. -
Pass a parameter from a report to a customization form of another report
Hello,
I want to pass a parameter value from a report to the customization form of another report and display it in the text field in the customization form as a default value. I have 2 variables in the customization form and in one of them, I would like to display the default value from a previous report.
Thank you
Jayasree1. go to the manage component screen of the report
2. open the package body (pl/sql source)
3. search for 'procedure show_parms'
4. scroll down till you find
-- call to parameter form rendering engine
5. copy the procedure call below it
a) you will have to pass <PORTAL_SCHEMA>.wwv_utlglobl.RUN_AS_NORMAL to p_mode
b) remove the parameters p_reference_path, p_redirect_url, p_exec_mode, p_page_url ( or you can pass null to them)
c) 'p_parm_names' will contain your 2 parameters
d) you can pass values to 'p_parm_values' which you want to be displayed in the parameter forms.
6. you can call this procedure from a dynamic page and link the dynamic page to your first report -
Hi
I have created report with region source as pl-sql. In pl-sql block, calling package where i am passing query. In query's where clause i want to pass paramter value which user had selected.
There are two regions on page. On upper part, there is select list, on lower part there is report with pl-sql region but value of select list is not found in query. I am trying to access with bind variable, select list of item :SL_TEXT. But it is not showing any value in it.
How to use select list value in query of report? Or let me know how to use parameter in pl-sql report which is selected in other region?
Thanks in advanceI am attempting to define the variable as a date variable through Oracle BI and yes it does use a colon to signal variable substitution.
So thank you the first way you stated should work.
The only problem I'm running into now I believe steems from the date format that column that I am trying to filter on. It is in what appears to be the worst format possible.
Is it common for dates to be stored in a DD-MON-YY format? (e.g. 01-JAN-08) I thought we as a community had moved past that post Y2K scare. lol.
When I set up the bind variable in BI it allows me to define the date format, much similar to the TO_DATE function but then it says (must be java date format). So I'm thinking that maybe DD-MON-YY is not a java date format.
In that case is there a way to cast or convert my date format in the sql so that it is a supported java date format?
Or should I just give up and pass it as a varchar2? -
How to change sql server reports parameter direction in report builder 3.0
Hi All,
I have created few reports using Report Builder 3.0 with the data source as SharePoint list. i have created a web part page and added the ".rdl"
file, everything is working as expected. Later, i got a requirement to add a parameter to the report , i did that and when i ran the report in SharePoint page, the parameters shows right side and the parameter ribbon shows the dropdown control on top and "Apply
button" at the bottom. When i presented this to my manager, he says the parameter ribbon looks bad and suggested to put both the controls together and also instead of displaying at right side vertical, display it horizontal.
I have below queries
How can i change the direction of parameter ribbon from vertical to horizontal
How can i bring the controls together (e.g. dropdown list control and button)
How can i add buttons on the report in report builder 3.0
How to get/reflect the data in report without refreshing the page.
Can someone please guide me, how to achieve the above functionalities..
MercuryManUnfortunately, where the parameters are located and the button distance away from the parameters are not something you can customize. Here are the options available for customization:
http://msdn.microsoft.com/en-us/library/bb326214.aspx
Trevor Seward
Follow or contact me at...
  
This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs. -
Passing Parameter from Main report to SQL command-based subreport
I am trying to cut down the run time of my reports and have recently figured out how to write SQL commands to limit the data by filtering prior to being pulled into the reports. However, many of my reports rely on multiple sub reports, which can cause a dramatic 'drag' on the report.
I am trying to filter the SQL command used in my sub report by passing the group parameter, which is selected by the user in the main report, to the sub report's SQL command. Without this parameter, the sub report has to sort through a lot more data than it would with this parameter, making the run time extremely slow.
Any suggestions on how I can accomplish this?
Thanks for any help you can provide,
Marlene Allen
Crystal Reports Developer
Crystal Reports Professional;
Product Type: Full;
Product Version 11.5Hi Marlene,
I don't believe you can pass a CR parameter to a Command object.
I suggest replacing all of the Command Objects with a Stored Procedure so all of the data filtering is done server side. DB servers are much more proficient at collecting the data and filtering than CR will ever be. It will also allow you to replace subreports to also speed up your report processing. All depends on your layout of course but something to look at.
Thank you
Don -
How to add a parameter to sql query in report
Hi
How to add a parameter to sql query in report.
Parameter is from Visual studio
example:
select * from tab1 where dl=parameter???
I have VS 2008 prof CR XI R2, mysqlHello,
If you have this API available then you can modify the record selection formulae in code to add filtering:
string recordSelectionFormula = "{T_INV_RPT_ADDR.IND_PROMUS} = {?P_PROMUS?} AND {T_INV_RPT_POINT.INVOICE_DATE} = DATE(2008, 05, 31) AND {T_INV_RPT_POINT.CHECKOUT_DATE} = date(2008, 04,29)";
CrystalDecisions.CrystalReports.Engine.ReportDocument.RecordSelectionFormula = recordSelectionFormula;
You have to format and follow the rules as in the Designer so not too much work to get this to work.
CR for .NET may not have the ability so you will need to upgrade to a Developer version of Crystal Reports.
Thank you
Don -
hi,
my name is Pedro Mesquita, from Portugal Europe.
i have this problem with my client and it seems it is common to all other projects : i have a report with parameters depending on each other (but curiously this happens also with reports without depending parameters and the order for which thay are created
counts!) and when the user changes one parameter the screen (sql reporting front-end) does a postback and refreshs! is this by design by microsoft ?! the client wants to keep the previous rendered report to help him build the new one.
how can i avoid this?
microsoft help please?
best regards
Pedro MesquitaOh Microsoft.....
This means that we must build our front-end to control this "feature"....
AJAX would solve this....
Thank you.
Best Regards,
Pedro
Pedro Mesquita -
I have a SQL report which returns 15 colums. Rather than format the report vertically with 15 rows for each record or horizontally with 15 columns for each record, I'd like to return a 3x5 table of values - is this possible.
The problem is when I execute a report and I want to
print it, the page break is not done. I want toHTML does not have any concept of a "page break" or a page even. The browser just sends the currently displayed HTML BODY content to the printer and the printer takes it from there.
Google for HTML page break and see what you find
http://www.google.com/search?hl=en&q=html%20page%20break&btnG=Google+Search
If system user want to print the report they don't
want to have problem and make a lot of test before
having the report they want. Is it possible to move
column like Discoverer ?What you see (in the browser) is what you get on the printer.
You can implement some simple column re-ordering functionality in your report using some of the techniques I showed at
Swapping columns on reports
You can even show/hide columns as per Carl's example at
http://htmldb.oracle.com/pls/otn/f?p=11933:46
So, user can play around with this until the desired columns are seen in the desired order and then use the browser's Print function to print what is on the screen.
Hope this helps. -
[Interface] - Passing variety parameters/input to PL/SQL report
Hi,
I've the PL/SQL report which can allow passing in the parameter, i use '&'.
the report is given to the end user who do not have the IDE for PL/SQL. the machanism of the report is generated into the spool file and import into excel format.
now i am wondering how to create a tool using SQL or PL/SQL to allow the end user to choose the parameter(s) dynamically and passing into the PL/SQL to generate the report based on the input selected.
the parameters like below:
package code :
week no :
year :
department :
all the above parameters, the data would be selected from the existing lookup table. the user is allow to select more than 1 input for specified parameter for instance i want to spool report for week 1 until week 5.
pls advise any solution on this topic. thankshi scoot,
thank for reply.
yep, i'm using sql*plus and also sql navigator 4.0 .
the user don't have the software to interact. i'm thinking of build an simple interface using VB and passing in the parameter then initiate the sql*plus to run the program in background mode.
but if you have any other solution which not need to use other software to wirte such program , pls let me know immediately. thank -
How to Convert MM/DD/YYYY to YYYY/MM/DD in SQL Reporting Services
i am having difficulty of converting a parameter field, called @startdate, on sql reporting services report to YYYY/MM/DD format. the parameter @Startdate was set to Data/Time. @Startdate is 6/1/2014 12:00:00 and I want to convert it
to 2014/06/01. I want to compare @Startdate with a column in database called Begindate which is in format of YYYY/MM/DD hh:mm:ss. I tried the followings
select * from Atable where cast(Atable.Begindate as date) >= cast(@Startdate as date)
select * from Atable where cast(Atable.Begindate as date >= cast(convert(datetime, @Startdate) as date)
SQL Reporting Services only gives me Text, Boolean, Date/Time, Integer and Float.
Regards,Hi Elmucho,
Sorry for the delay. I tested with the sample data you provided, however everything works well in-house. Could you please creste a new report and check the result. Here are the steps I performed:
1. Create a table and insert the following data:
Name (varchar(50)) Begindate (datetime, not null)
Lastdate (datetime, not null)
bob
2008-01-01 08:08:08.000 2010-10-10
10:10:10.000
alice
2010-10-10 10:10:10.00 2011-11-11
11:11:11.000
smith
2011-11-11 11:11:11.00 2012-12-12
12:12:12.000
2. Open SQL Server Data Tools, create the data source and add the dataset with the below query:
SELECT Name, Begindate, Lastdate
FROM [tablename ]
WHERE (CAST(Begindate AS date) >= CAST(@Startdate AS date)) AND (CAST(Lastdate AS date) <= CAST(@Enddate AS date))
3. Then, click execute button, it prompts for inputting the parameter value.
@Startdate
6/1/2008
@Enddate
5/1/2014
Enter the date and press OK.
4. Here is the result in the query designer:
Insert a table and fields. Save the report and preview:
Thanks.
Tracy Cai
TechNet Community Support -
How to set a default date as a parameter in Microsoft Reporting Services 2008 to January 1st
How can I set a default parameter for date for 01/01/yyyy.
Hi Giss68,
If I understand correctly, you want to set the first day of current year as a default value of a parameter in Microsoft Reporting Services 2008 report.
If in this scenario, we can use the expression below as the default value in the parameter:
=DateAdd("d",-DatePart(DateInterval.DayOfYear,Today,0,0)+1,Today)
The following document about DateAdd function is for your reference:
http://technet.microsoft.com/en-us/library/aa337194(v=sql.100).aspx
If there are any other questions, please feel free to ask.
Thanks,
Katherine Xiong
If you have any feedback on our support, please click
here.
Katherine Xiong
TechNet Community Support -
Can we use formula column in lexical parameter in sql query ...
hi
can we use formula column in lexical parameter in sql query ...
as example
i want to give
select * from & c_table
forumula
function c_table
if :p_sort = 1 then
return 'dept'
else
return 'emp'
end;
c_table formula column
is this possible ...
i have such example in oracle apps reports
if i try in ordinary report usinf emp table it show error ..
how we can give formula column...
please help me in this regard...
Edited by: 797525 on Feb 20, 2012 9:31 PMthanks sir,
iam not exactly saying select * from &c_table but some thing that like columns in select stmt also will be populated in user_parameters ,there are lot of table select.......from mtl_demand md, mtl_system_items msi, mtl_txn_source_types mtst, mtl_item_locations loc &C_source_from &C_from_cat
&c_source_from and &c_from_cat formula column and there are defined at report level only ......
pl/sql code &c_source_from is
function C_source_fromFormula return VARCHAR2 is
begin
if :P_source_type_id = 2 then return(',MTL_SALES_ORDERS mkts');
else if :P_source_type_id = 3 then return(',GL_CODE_COMBINATIONS gl');
else if :P_source_type_id = 6 then return(',MTL_GENERIC_DISPOSITIONS mdsp');
else if :P_source_type_id = 5 then
if :C_source_where is null then
return NULL;
else
return(',WIP_ENTITIES wip');
end if;
else if :P_source_type_id = 8 then return(',MTL_SALES_ORDERS mkts');
else if :P_source_type_id is null then
return(',MTL_SALES_ORDERS mkts,
MTL_GENERIC_DISPOSITIONS mdsp,
GL_CODE_COMBINATIONS gl ');
else null;
end if; end if; end if; end if; end if; end if;
RETURN NULL; end;
this is forumula column i hope that you understand what iam saying
please help me in this regard....
thanking you... -
SQL report link to another report
Hello,
I am using Apex 4 and trying to link an sql report with another report. If I were able to use an interactive report I could easily link that to another page, but that would require me to have a primary key. The problem is that I need to link a few tables. So two questions:
1.) Can I link these via an HTML link to my other page? I would have a HTML link in my report that would link via URL parameter passing. So can I use HTML in a report?
2.) What is the syntax for a parameter passing via URL? Here is my link that would be:
a href= f?p=107:40:&APP_SESSION::::P40_NAME:MARK: Are there any other ways to accomplish this?
Thanks,
Mark
Edited by: LondonMark on 23-May-2011 04:18
Edited by: LondonMark on 23-May-2011 04:20I am using Apex 4 and trying to link an sql report with another report. If I were able to use an interactive report I could easily link that to another page
It's easy in standard reports< /a>. (Ignore the "Interactive Report" typo in step 1.)
1.) Can I link these via an HTML link to my other page? I would have a HTML link in my report that would link via URL parameter passing. So can I use HTML in a report?You can, but it's better practice to keep data retrieval and HTML structure separate when possible—in this case by using declarative Column Links.
2.) What is the syntax for a parameter passing via URL?This is also covered in the documentation.
Here is my link that would be: a href= f?p=107:40:&APP_SESSION::::P40_NAME:MARK:
{quote}
That looks to have the order of the parameters correct, but it's missing some syntax:<a href="f?p=107:40:&APP_SESSION.::::P40_NAME:MARK">...</a>
The static text exact substitution method of referencing the value of an APEX item requires a terminating dot ("."): <tt>&APP_SESSION.</tt> -
Conditional display in a SQL-Report/Report Region
Hi,
here I have an example for "Conditional display in a SQL-Report/Report Region". I figured it out in Firefox 3.6.2 using Firebug as development tool on Apex 3.2.1.00.12.
First you have to put the following javascript code in the Page HTML-Header:
<script type="text/javascript">
<!--
// SOURCE
// W:\oracle\PRJ DWLS\javascript.07.js
// Beispiel Funktion zur bedingten Formatierung einer Tabellenzelle.
// Help (Substitution Strings):
// http://htmldb.oracle.com/pls/otn/wwv_flow_help.show_help?p_lang=de&p_session=2412201185523196&p_flow_id=4003&p_step_id=420,4003
// HTML Expression:
// <script>ex_conditional_td('R094260001010', #ROWNUM#, #COLNUM#-1);</script>#DFT_COND1#
function ex_conditional_td
( p_id
, p_rownum
, p_cellnum
var l_td;
l_td = vd_getColumn(p_id, p_rownum, p_cellnum);
// hier die Bedingung definieren
if (true) {
l_td.style.color = '#808080';
} // -- eof ex_conditional_td -- //
// Beispiel Funktion zum Abstellen der onMouse Funktionalität der Tabellenzeile
// HTML Expression:
// <script>ex_conditional_tr('R094260001010', #ROWNUM#);</script>#DFT_ID#"
function ex_conditional_tr
( p_id
, p_rownum
var l_tr; // TABLE.TR
var l_td; // TABLE.TR.TD
if (true) {
l_tr = vd_getRow(p_id, p_rownum);
l_tr.onmouseover = null;
l_tr.onmouseout = null;
for (var i=0; i<l_tr.cells.length; i++) {
l_td = l_tr.cells;
l_td.style.backgroundColor = '#DDDDDD';
} // -- eof ex_conditional_tr() -- //
var g_DEBUG = false;
var g_TBODY = null;
// Liefert das Body-Element der Tabelle mit der ID <p_id>.
// Parameter
// p_id - die Id der HTML-Tabelle
// Return
// das Body-Element oder NULL, wenn die Zeile nicht gefunden wurde
function vd_getBody
( p_id
if (g_TBODY == null) {
var l_table = null;
l_table = document.getElementById( p_id );
if (l_table == null) {
l_table = document.getElementByName( p_id );
if (l_table != null) {
if (vd_debug()) {
alert("Tabelle gefunden, " + l_table.nodeName);
g_TBODY = vd_search( l_table, 'TD', 't10data', 'TBODY');
return g_TBODY;
} // -- eof vd_getBody() -- //
// Liefert die Zeile <p_rownum> der HTML-Tabelle mit der Id <p_id>.
// Parameter
// p_id - die Id der HTML-Tabelle
// p_rownum - die Zeilennummer
// Return
// die Zeile oder NULL, wenn die Zeile nicht gefunden wurde
function vd_getRow
( p_id
, p_rownum
var l_body = vd_getBody(p_id);
if ( l_body != null
&& l_body.nodeName == 'TBODY'
&& l_body.children[p_rownum].nodeName == 'TR') {
return l_body.children[p_rownum];
else {
return null;
} // -- eof vd_getRow() -- //
// Liefert die Spalte <p_column> der Zeile <p_rownum> der HTML-Tabelle mit der
// Id <p_id>.
// Parameter
// p_id - die Id der HTML-Tabelle
// p_rownum - die Zeilennummer
// p_column - der Index der Spalte / Zelle
// Return
// die Zelle oder NULL, wenn die Zelle nicht gefunden wurde
function vd_getColumn
( p_id
, p_rownum
, p_column
var l_tr = vd_getRow(p_id, p_rownum);
if ( l_tr != null
&& l_tr.nodeName == 'TR'
&& l_tr.children.length >= p_column
&& l_tr.children[p_column].nodeName == 'TD') {
return l_tr.children[p_column];
else {
return null;
} // -- eof vd_getColumn() -- //
// Rekursives Suchen nach einem Node.
// Zweck: Das bedingte Formatieren einer Tabellenzelle in einem Apex Standard
// SQL-Report.
// Diese Funktion durchsucht rekursiv, ab einem Ausgangsknoten <p_node>, alle
// darunter befindlichen Elemente, ob in dem Element <p_seachIn> sich die
// Klasse <p_class> befindet.
// Bei Standard-Reports ist die Reportzelle (TD) mit der Klasse
// "t10data" formatiert.
// Zunächst muss dazu die Tabellenzelle (TD) selbst, die übergeordnete
// Tabellenzeile (TR), der Tabellenbody (TBODY) oder die Tabelle (TABLE)
// selbst ermittelt werden.
// Der Beispielaufruf:
// var l_body;
// var l_node = document.getElementById( 'R112233' );
// l_body = search( l_node, 'TD', 't10data', 'TBODY');
// durchsucht also das mit der Id "R112233" versehene Element [der Report, für
// den in Apex eine statischen ID vergeben werden musste] rekursiv, bis er
// die [erste] Tabellenzelle "TD" findet, die als Klasse "t10data"
// definiert hat. Für diese ermittelt er dann das übergeordnete TBODY-Element.
// Parameter
// p_node - das Ausgangselement
// p_searchIn - der Knotenname, der durchsucht werden soll
// [node.nodeName == p_searchIn]
// p_class - der Name der CSS Klasse
// [node.classList[<index>] == p_class
// p_parentName - der Name [node.parentNode.nodeName == p_parentName]
// des Elements, das zurückgeliefert werden soll. Wird als
// p_parentName der Suchname p_searchIn angegeben, wird
// das Element selbst zurückgegeben.
// Return
// das per p_parentName gesuchte Element (TD, TR, TBODY, TABLE)
function vd_search
( p_node
, p_searchIn
, p_class
, p_parentName
var LN = "vd_search";
var l_element = null;
// DEBUG
if (vd_debug()) {
alert(LN + ":" + "Untersuche " + p_node.nodeName + ", id=" + p_node.id);
// 1) der aktuelle Knoten ist der, der durchsucht werden soll
if (p_node.nodeName == p_searchIn) {
if (p_node.classList.length > 0) {
for(var c=0; c<p_node.classList.length; c++) {
if (p_node.classList[c] == p_class) {
// Parent Node dynmisch suchen
l_node = p_node;
if (l_node.nodeName == p_parentName) {
return l_node;
while(l_node != null && l_node.parentNode != null) {
if (l_node.parentNode.nodeName == p_parentName) {
return l_node.parentNode;
else {
l_node = l_node.parentNode;
// 2) wenn nicht 1) oder nicht in 1) gefunden, dann in den Kindelementen
// weitersuchen
if (p_node.children.length > 0) {
var i = 0;
while (i<p_node.children.length && l_element==null) {
l_element = vd_search( p_node.children[i], p_searchIn, p_class, p_parentName);
i++;
return l_element;
} // -- eof vd_search() -- //
// Gibt an, ob Debug ein- (true) oder ausgeschaltet (false) ist.
// Return
// true - debug ist eingeschaltet
// false - debug ist ausgeschaltet
function vd_debug()
return g_DEBUG;
-->
</script>
Maybe you have to modify the "vd_getBody" function. I'm searching the table cell with having the class "t10data". When you use another theme, there's maybe another class used.
Second is, that you set an static id for your report region. I prefer this structure:
R<app-id><page-id><seq> (Raaaaappppsss) e.g. R094260001010.
First example is to turn off the onMouse-Effect. Maybe on the first or last column definition you put this code in the "HTML-Expression" area:
<script>ex_conditional_tr('R094260001010', #ROWNUM#);</script>#ID#This will call the example function ex_conditional_tr with the parameter
a) the region id
b) the rownum (as oracle always starts with 1 this is the first data row [rownum=0 is the table header row])
Second example is the conditional formatting of a table cell. Put this in the HML-Expression area:
<script>ex_conditional_td('R094260001010', #ROWNUM#, #COLNUM#-1);</script>#ENAME#This will call the example function ex_conditional_tr with the parameter
a) the region id
b) the rownum
c) the cellnum (here we have to subtract 1 to get the "real" cell index)
The "ex_conditional" functions are just a representation of how to get the row or cell node.
Hope this help a bit.
TomI would use a CASE statement in the select....
each CASE would be an img src tag for a different button if the button is an image.
does that make sense? I can include an example if you would like...
Maybe you are looking for
-
Some problem in my nokia c6 (stop or retry)
Hi sir, i was worrking in my nokia c6 mobile some times it shows stop or retry option. I cant able go to next steps. And also i can't switched off the mobile. Just uu open my back panel and remove the battery then insert the battery and switch on my
-
Cisco Email Security Appliance (ESA) - Reporting
In previous versions on ESA you could export data and reports in CSV formats using an API. Is that still available? >From the following document : IRONPORT ASYNCOS 6.4 REPORTING API FOR IRONPORT APPLIANCES REPORTING API OVERVIEW The Reporting API fea
-
Hi, just need to know how to get my music, video, pictures and apps form my iPhone to my new laptop as the old computer, which I used before was stolen. I only have my phone left and if I try to conect it to my new laptop it's trying to delete everyt
-
yahoo comes up, then in switching to mail, the mail appears and I can look at each piece. However, the delete, move, and reply buttons are not responding. Also, I can't generate a new message. The system works fine with IE or Google Chrome.
-
Hey all, I've narrowed it down to a point I'll post some specs to see what you guys think (mainly for parts compatibility reasons). I have a set budget so this is going to have to work. MSI K8N Neo2 Platinum AMD64 3200+ 90nm 1 GB Corsair ValueSelect