Retrieve All records and display in Report using CAML query in Report Builder if Parameter value is blank
Hello Experts,
i have created a report where i have one parameter field where user will pass parameter(e.g. EmpId). As per parameter record will fetched to report if no parameter is passed then it will display all records. I have done it by taking SqlServer Database as datasource.
by using Following method
Now i would like to do it by taking Sharepoint List as Datasource. For that what would be the CAML Query.
Here is my existing CAML query.
<RSSharePointList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ListName>Employees</ListName>
<ViewFields>
<FieldRef Name="Title" />
<FieldRef Name="FirstName" />
<FieldRef Name="LastName" />
<FieldRef Name="FullName" />
<FieldRef Name="UserName" />
<FieldRef Name="Company" />
</ViewFields>
<Query>
<Where>
<Eq>
<FieldRef Name="Title" />
<Value Type="Text">
<Parameter Name="EmployeeId"/>
</Value>
</Eq>
</Where>
</Query>
</RSSharePointList>
The above code is working if i am passing an employeeId to Parameter. If nothing is passed, it is Not retrieving any record.
Please suggest
Thank you
saroj
saroj
Your problem follows the well-established pattern of using an "All" parameter filter in SSRS. There are a few approaches depending on the size of your data. The easiest one is to return all data from CAML and then filter it within SSRS, the following thread
provides some examples,
http://stackoverflow.com/questions/18203317/show-all-records-some-records-based-on-parameter-value.
Other options include passing all of the possible values within the CAML query when "All" is selected, using multiple Report Files to distinguish between both CAML queries, or to use multiple datasets with some logic to show/hide the correct one.
Dimitri Ayrapetov (MCSE: SharePoint)
Similar Messages
-
How to retrieve Task Lists from All Subsites to the Parent Site and display in Grid view using CAML Query + object model
do u just want task list or items under task list for all subsites
for items use spsitedataquery ref
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsitedataquery.aspx use recursive to get it from alll subsite under site collection
for tasklist only u can a simply use a for loop to find in all subsite
Manish Sati -
Reading the record and displaying when u select it using checkbox
hi,
how to read the particilar record and display it in a popup screen when u select it using checkbox and then press 'DISP' button in alv(normal alv not with oops concepts).
like i select a row which is checked (checkbox) it and i have to read that particular record and display (value of keyfield say vbeln) details in a popup screen.hi,
go through the faloowing code.
this for normal popup.
*& Report ZGS_ALV_POPUP_2_SELECT
REPORT ZGS_ALV_POPUP_2_SELECT.
TYPE-POOLS: slis.
PARAMETERS: p_title TYPE sy-title default 'Sales Document:item data'.
DATA: itab TYPE vbap OCCURS 0 WITH HEADER LINE,
selfield TYPE slis_selfield.
START-OF-SELECTION.
SELECT *
FROM vbap
INTO TABLE itab
UP TO 20 ROWS.
CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
EXPORTING
i_title = p_title
* I_SELECTION = 'X'
I_ZEBRA = 'X '
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* I_CHECKBOX_FIELDNAME =
* I_LINEMARK_FIELDNAME =
* I_SCROLL_TO_SEL_LINE = 'X'
i_tabname = 'ITAB'
i_structure_name = 'VBAP'
* IT_FIELDCAT =
* IT_EXCLUDING =
* I_CALLBACK_PROGRAM =
* I_CALLBACK_USER_COMMAND =
* is_private =
IMPORTING
es_selfield = selfield
* e_exit =
TABLES
t_outtab = itab
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE i000(8I) WITH sy-subrc.
ENDIF.
WRITE:
/ 'Table Index : ', 20 selfield-tabindex,
/ 'Table Name : ', 15 selfield-tabname,
/ 'Field Name : ', 15 selfield-fieldname,
/ 'Table-Field : ', 15 selfield-sel_tab_field,
/ 'Field Value : ', 15 selfield-value.
the falowing code is for how to put checkbox and how to display the selected recods.you combine both codes.
*& Report ZRP_SALES
REPORT ZRP_SALES NO STANDARD PAGE HEADING.
DATA: TEMP_DATE_STR TYPE STRING.
*DATA: TEMP_NETP LIKE VBAK-NETWR.
DATA: TEMP_NETWR(10).
*DATA: TEMP_VBELN LIKE VBAK-VBELN.
DATA: CHECK TYPE C VALUE ' '.
*DATA: WA_VBELN LIKE VBAK-VBELN.
DATA: TEMP_DATE LIKE VBAK-ERDAT.
*DATA: TEMP_NETP_STR TYPE STRING.
DATA:FNAM(20), FVAL(20).
TYPES: BEGIN OF MY_VBAK,
VTWEG TYPE VTWEG,
VKORG TYPE VKORG,
SPART TYPE SPART,
NETWR TYPE NETWR_AK,
VBELN TYPE VBELN_VA,
ERDAT TYPE ERDAT,
END OF MY_VBAK.
DATA: IT_VBAK TYPE MY_VBAK OCCURS 0 WITH HEADER LINE.
DATA: WA_VBAK TYPE MY_VBAK.
DATA: V_VBELN TYPE VBELN,
V_ERDAT TYPE ERDAT.
SELECT-OPTIONS:S_VBELN FOR V_VBELN,
S_ERDAT FOR V_ERDAT.
AT SELECTION-SCREEN.
*Check for Sales Order number to be non-initial.
IF S_VBELN IS INITIAL.
*Checking for Date to be non-nitial.
IF S_ERDAT IS INITIAL.
MESSAGE E003(ZRP_MSG). " Please enter either SO number or Date.
ELSE.
*Validating the right low values for Date select option
SELECT SINGLE ERDAT
FROM VBAK INTO TEMP_DATE
WHERE VBELN EQ S_VBELN-LOW OR ERDAT EQ S_ERDAT-LOW.
IF SY-SUBRC NE 0.
MESSAGE E004(ZRP_MSG).
ENDIF.
*Validating the right high values for Date select option
SELECT SINGLE ERDAT
FROM VBAK INTO TEMP_DATE
WHERE ERDAT EQ S_ERDAT-HIGH OR VBELN EQ S_VBELN-HIGH.
IF SY-SUBRC NE 0.
MESSAGE E005(ZRP_MSG).
ENDIF.
ENDIF.
ELSE.
*Checking for Date to be non-nitial.
IF S_ERDAT IS NOT INITIAL.
MESSAGE E003(ZRP_MSG). " Please enter either SO number or Date.
ENDIF.
*Validating the right low values
SELECT SINGLE VBELN
FROM VBAK INTO S_VBELN
WHERE VBELN EQ S_VBELN-LOW.
IF SY-SUBRC NE 0.
MESSAGE E001(ZRP_MSG).
ENDIF.
*Validating the right high values
IF S_VBELN-HIGH IS NOT INITIAL.
SELECT SINGLE VBELN
FROM VBAK INTO S_VBELN
WHERE VBELN EQ S_VBELN-HIGH.
IF SY-SUBRC NE 0.
MESSAGE E002(ZRP_MSG).
ENDIF.
ENDIF.
ENDIF.
START-OF-SELECTION.
*First Screen.
SET PF-STATUS 'DISP'.
IF S_VBELN IS NOT INITIAL.
SELECT VTWEG VKORG SPART NETWR VBELN ERDAT
FROM VBAK
INTO TABLE IT_VBAK
WHERE VBELN IN S_VBELN.
ENDIF.
IF S_ERDAT IS NOT INITIAL.
SELECT VTWEG VKORG SPART NETWR VBELN ERDAT
FROM VBAK
INTO TABLE IT_VBAK
WHERE ERDAT IN S_ERDAT.
ENDIF.
SORT IT_VBAK BY VKORG VTWEG SPART.
END-OF-SELECTION.
LOOP AT IT_VBAK.
MOVE IT_VBAK-NETWR TO TEMP_NETWR.
MOVE IT_VBAK-ERDAT TO TEMP_DATE.
WRITE:/6 CHECK AS CHECKBOX.
FORMAT COLOR 1.
WRITE: IT_VBAK-VBELN UNDER 'SALES ORDER NO.' .
WRITE: IT_VBAK-ERDAT UNDER 'DATE'.
FORMAT COLOR OFF.
FORMAT COLOR 2.
WRITE: TEMP_NETWR UNDER 'NET PRICE'.
FORMAT COLOR OFF."TEMP_NETWR,
FORMAT COLOR 3.
WRITE:IT_VBAK-VKORG UNDER 'SALES ORG',
IT_VBAK-VTWEG UNDER 'DIST CHANNEL',
IT_VBAK-SPART UNDER 'DIVISION'.
FORMAT COLOR OFF.
SKIP 1.
*FOR SUBTOTALS
AT END OF SPART.
SUM.
FORMAT COLOR 5.
WRITE:/6 'SUB TOTOAL OF NET PRICE IS : '.
WRITE: 32 IT_VBAK-NETWR CURRENCY 'INR'.
FORMAT COLOR OFF.
SKIP 2.
ENDAT.
*FOR GRAND TOTALS
AT LAST.
SUM.
FORMAT COLOR 6.
WRITE:/6 'GRAND TOTOAL OF NET PRICE IS : ',
32 IT_VBAK-NETWR CURRENCY 'INR'.
FORMAT COLOR 6.
ENDAT.
ENDLOOP.
TOP-OF-PAGE.
FORMAT COLOR 6.
WRITE:/8 'SALES ORDER NO.',
27 'DATE',
42 'NET PRICE',
57 'SALES ORG',
70 'DIST CHANNEL',
87 'DIVISION'.
FORMAT COLOR OFF.
SKIP 1.
*WHEN SALES ORDER IS SELECTED
AT LINE-SELECTION.
CASE :SY-LSIND.
WHEN '2'.
GET CURSOR FIELD FNAM VALUE FVAL.
IF FNAM <> 'WA_VBAK-VBELN'.
MESSAGE E006(ZRP_MSG).
ELSE.
SET PARAMETER ID 'MAT' FIELD FVAL.
CALL TRANSACTION 'MM02' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
*WHEN CLICKED ON PUSH BUTTON IN THE APPLICATION BAR
AT USER-COMMAND.
CASE:SY-UCOMM.
WHEN 'DISP'.
DO.
CLEAR CHECK.
CLEAR: WA_VBAK,TEMP_DATE_STR.
READ LINE SY-INDEX FIELD VALUE CHECK
IT_VBAK-VTWEG INTO WA_VBAK-VTWEG
* IT_VBAK-NETWR INTO TEMP_NETP_STR
IT_VBAK-VBELN INTO WA_VBAK-VBELN
IT_VBAK-ERDAT INTO TEMP_DATE_STR
IT_VBAK-VKORG INTO WA_VBAK-VKORG
IT_VBAK-SPART INTO WA_VBAK-SPART.
IF SY-SUBRC <> 0.
EXIT.
ELSEIF CHECK = 'X'.
FORMAT COLOR 1.
WRITE: 8 WA_VBAK-VBELN HOTSPOT. "UNDER 'SALES ORDER NO'
WRITE: 25 TEMP_DATE_STR." UNDER 'DATE'.
FORMAT COLOR OFF.
* FORMAT COLOR 2.
* WRITE: 44 TEMP_NETP_STR." UNDER 'NET PRICE'.
* FORMAT COLOR OFF.
FORMAT COLOR 3.
WRITE:44 WA_VBAK-VKORG," UNDER 'SALES ORG',
59 WA_VBAK-VTWEG," UNDER 'DIST CHANNEL',
72 WA_VBAK-SPART." UNDER 'DIVISION'.
FORMAT COLOR OFF.
SKIP 1.
ENDIF.
ENDDO.
ENDCASE.
TOP-OF-PAGE DURING LINE-SELECTION.
CASE:SY-LSIND.
WHEN 1.
FORMAT COLOR 6.
WRITE:/8 'SALES ORDER NO.',
25 'DATE',
* 44 'NET PRICE',
44 'SALES ORG',
58 'DIST CHANNEL',
72 'DIVISION'.
SKIP 1.
FORMAT COLOR OFF.
<b>if helpful reward some points.</b>
Message was edited by:
suredarreddy pulimamidi -
Personnel Admin AdHoc Query not retrieving all records
Hi, I recently added a custom info type to a copy of the SAP ad hoc query for Personnel Admin by using the menu path in SQ02>Edit>Change Infotype selection . The query is picking up the new info type and runs fine but does not retrieve all records from the table for a given personnel id. It only retrieves 1 record per id.
Has anyone dealt with this before and have an easy/quick fix for this?Have other users try the query, preferably a user with end user authorization.
I've had this issue before, I'm an IT person and I customized a Standard infoset.
During testing, I'm only getting 1 (in my case) Insurance record per employee.
The end user can see multiple record per employee.
Btw, did you customize a Global or a Standard Infoset?
Regards,
Olekan -
Please HELP to retrieve all records in PL/SQL --Still waiting for solution
First of all, I am a PL/SQL beginner. I need help to retrieve all records in PL/SQL from a database (maybe anyone could give me an example). Here is my code, but this code is only able to retrieve one records only. I would like to create a web service by using PL/SQL to view data in a table.
CREATE or REPLACE package body DRIVER_FETCHER as
FUNCTION get_driver(driver_id in VARCHAR2) RETURN driver_rec IS
driver_found tblDrivers%rowtype;
driver_rtn driver_rec;
BEGIN
SELECT *
INTO driver_found
FROM tblDrivers;
WHERE tblDrivers.lngDriverID=driver_id;
driver_rtn := driver_rec
driver_found.lngDriverID,
driver_found.strTitle,
driver_found.strFirstName,
driver_found.strLastName,
driver_found.dteDOB,
driver_found.dteDateLicensed,
driver_found.strLicenseReference,
driver_found.strAddress_Street,
driver_found.strAddress_TownVillage,
driver_found.strAddress_Country,
driver_found.strAddress_PostCode,
driver_found.strContactDayPhone,
driver_found.strContactNightPhone
RETURN driver_rtn;
END;
END;
and here is the tblDrivers table
CREATE or REPLACE type DRIVER_REC as object
lngDriverID varchar2(10),
strTitle varchar2(5),
strFirstName varchar2(20),
strLastName varchar2(20),
dteDOB date,
dteDateLicensed date,
strLicenseReference varchar2(30),
strAddress_Street varchar2(50),
strAddress_TownVillage varchar2(20),
strAddress_Country varchar2(15),
strAddress_PostCode varchar2(10),
strContactDayPhone varchar2(20),
strContactNightPhone varchar2(20)
CREATE or REPLACE package DRIVER_FETCHER as
FUNCTION get_driver(driver_id IN VARCHAR2) RETURN driver_rec;
END;
Thank You,
Paul
Message was edited by:
user452391
Message was edited by:
user452391
Message was edited by:
user452391Hi,
you will enjoy reading
http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96624/toc.htm
for a fundamental understanding of PL/SQL.
You can do a "select * from t;" only in SQL, not in PL/SQL. There you have to open a cursor and fetch the results into a variable, e.g.:
declare
cursor c_example
is
select * from emp;
begin
for r_example in c_example loop
dbms_output.put_line(r_example.empno);
end loop;
end;This is an explicit cursor, opened within an "cursor for"-loop. The results are fetched into a (implicitly declared) record "r_example". The record now holds the values of one row from the emp table. The loop ends when all record from emp where fetched.
Regards,
Gerd -
What I would like to do is: display a data point every 1 sec but record the a data point every 10 sec.
I have been playing with the event case and loops to achive these but no mather what I get one or the other; I either record and display every sec or every 10 sec.
Thanks...Guru,
why doesn't it stop?
The timeout is connected with 1000ms so it will stop after 1 sec, doesn't it?
roddy,
it's right that the event-structure does not execute if you connect the control directly (as you did).
Try to connect the control using a property node and its property value (changed).
This will trigger the event-structure.
(Maybe you should use the LabVIEW help. I'm pretty much sure there is an example in it how to programatically trigger event structures)
IMHO it's not a smart solution anyways. The idea of a event structure is to capture user events (i.e. the frontpanel activities).
In your case it'maybe better to use a timed loop with 1000ms loop time, replace the event-structure with a case-structure, take the Rest from your modulo division and connect "Sine2" inside the case "0" of the case-structure.
When the Rest of your modulo division is != 0 then nothing happens.
Best regards,
Rainer
Message Edited by Balze on 12-18-2009 03:43 AM -
My iMessage and Facetime won't activate, says waiting for activation. All photos and contacts are restored, using email and wifi only, no service. Only issue is date and time will not automatically set.
Howdy eewebe13,
So you have no cellular service but are on Wi-Fi yet iMessage and Facetime are waiting for activation.
Please step through this article for that scenario.
If you get an error when trying to activate iMessage or FaceTime - Apple Support
Thank you for visiting Apple Support Communities.
Nubz -
How i can take all record that start for Epi using a select?
How i can take all record that start for Epi using a select?
exemple
select objnr from jest where objnr = 'Epi*' -
so don't goIs case important? Can it be "EPI"?
I think case is important, so do it like Shakir showed you, but put it in upper case.
Rob
Message was edited by:
Rob Burbank -
Created Webi report using BEx Query.
Hi All,
I am going to upgrade in BW and using BEx & Webi Report. I have created webi report using BEx query. Now I need to test data in webi report.
Can anyone tell me how to test data?
Regards,Hi,
compare the webi report data with Bex report. more you can compare webi report with SAP R3 system for random records.
Thanks,
Amit -
Sum and group by using CAML query
Is there any way to get the SUM of values with group by ID using CAML query?
I have a custom list, in that I have ID and Value columns as below
ID Value1 Value2
1 10 4
2 5 3
1 15 2
3 20 1
I want to get result:
ID Value1 Value2
1 25 6
2 5 3
3 20 1
I used CAML query:
<View>
<Query>
<Where>
<IsNotNull>
<FieldRef Name="ID" />
</IsNotNull>
</Where>
<GroupBy Collapse="FALSE">
<FieldRef Name="ID" />
</GroupBy>
</Query>
<ViewFields>
</ViewFields>
<Aggregations Value="On">
<FieldRef Name="Value1" Type="SUM" />
<FieldRef Name="Value2" Type="SUM" />
</Aggregations>
</View>
But
this query returns all the records
that satisfy the condition <Where>.
I
do not correctly?You need to work with current view based aggregation. Please check below threads for your reference.
http://social.msdn.microsoft.com/Forums/sharepoint/en-US/dda5735a-fecf-403f-9495-1b63617d2fbf/question-on-a-caml-query?forum=sharepointdevelopmentlegacy
http://social.msdn.microsoft.com/Forums/sharepoint/en-US/24e88d6a-ee15-4d81-a5fe-504c7bd14e46/how-to-sum-a-column-value-using-caml-query?forum=sharepointdevelopment
Hope this helps.
My Blog- http://www.sharepoint-journey.com|
If a post answers your question, please click Mark As Answer on that post and Vote as Helpful
I've seen these
issues and articles and do them, but
does not work. I use object mozhel
Sharepoint (javascript). -
Generating a report using ABAP query
Hi All,
I want to generate a anlytical report using ABAP query, There are 3 different transactions/steps have to be executed to get this data in an actionable form.
1. MB52 - Unrestricted Stock
2. ZCustomquery - Custom query in SAP R3
3. Combine above two in a single report.
Please suggest me how can i proceed,
1. Example i have created query name called Finalrepot
2. How can i call above zcustomquery and Transaction (MB52) in the Query.
Thanks for your help
PradeepHi,
Check below link to create ABAP query (SAP Query)
http://www.thespot4sap.com/Articles/SAP_ABAP_Queries_Create_The_Query.asp
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVQUE/BCSRVQUE.pdf
Best regards,
Brijesh -
Executing Crystal Report using BI Query as datasource in Bobj portal
I have a Crystal report using BI query as the datasource. The BI query contains User Entry variables.
The Crystal report executes as expected except when added to the Bobj portal. From the portal, I can schedule the report and it will execute as correctly. However, if I try to execute without scheduling, I am able to enter the BI restrictions, but then am presented the following error message: "An error has occurred: For input string: "" ".
If I remove all the BI variables from the query, the report will execute from the portal with out scheduling.
Any help would be greatly appreciated.Hi,
You can set your parameters from CMC. Select the report and set parameters in to the report properties.
-SG -
Error when trying to use this query in report region
Hi ,
I am getting "1 error has occurred
Query cannot be parsed within the Builder. If you believe your query is syntactically correct, check the ''generic columns'' checkbox below the region source to proceed without parsing. ORA-00933: SQL command not properly ended"
while trying to use this query in reports region .
Pls help.
Thanks ,
Madhuri
declare
x varchar2(32000);
begin
x := q'!select (first_name||' '|| last_name)a ,
count(distinct(session_id)),manager_name
from cappap_log,
MIS_CDR_HR_EMPLOYEES_MV
where DECODE(instr(upper(userid),'@ORACLE.COM',1),0,upper(userid)||'@ORACLE.COM',upper(userid)) = upper(email_address)!';
if :P1_ALL = 'N' then
x:= x||q'!and initcap(first_name ||' '|| last_name)=:P1_USERNAME!';
else
x:= x||q'!and initcap(first_name ||' '|| last_name)like '%'|| :P1_USERNAME||'%'!';
end if;
if :P1_APP_NAME = '%' then
x:= x||q'! and flow_id like '%'!';
else
x:= x||'flow_id = :P1_APP_NAME';
end if;
x:= x||q'! group by first_name||' '|| last_name , manager_name!';
return x;
end;Hi, I am actually stuck here. Can you please let me know which among these is the higher version.
1) Final Release 3.50
Version 3500.3.016
2) Final Release 3.50
Version (Revision 481)
Because it is working fine in the 1st one whereas its throwing that error pop-up in 2nd one(as soon as we select the Change query global definition option) . -
Development of Reports using ABAP Query
Hi
can anyone please tell me about 'Development of Reports using ABAP Query' and how to use it in real time
Thanks
jaylook here:
http://help.sap.com/saphelp_47x200/helpdata/en/b7/26ddebb1f311d295f40000e82de14a/frameset.htm
A. -
Hi,
I am using WebI Report using BW Query. I don't see some Formulas in Universe which is there in BEx Query.
Did anybody face the same problem before?Hi,
I meant that you should post in the forum the calculation contained in the formula that you cannot see in your universe.
But let's start from the begining since you are new to SAP: Did you generated the universe yourself? If the formula was added in the query after the universe was created then you must refresh your universe (In the Universe designer please select the option "Refresh structure" under the "view" menu) in order to get the newly created formula (I assume we are takling about a calculate figure here) in your universe also.
Regards,
Stratos
Maybe you are looking for
-
Hi all, I m using look up through JCO and calling a RFC on backend R/3 for the particular validation.I m using UDF for that.In the UDF i have specified imports as:- imports :-java.util.;java.lang.obj.;com.sap.aii.mapping.lookup.;com.sap.mw.jco.;java.
-
I was reading the tutorial on importing class's. This is what I read Importing classes To reference a class in another script, you must prefix the class name with the class's package path. The combination of a class's name and its package path is the
-
How to tell the model of W530 in Windows ?
If there is no sticker under the laptop, how can we tell which version of W530 this is? (Using Windows 7) Computer->Properties doesn't show. Is there a Lenovo help or system utility which provides more details? i.e. N1K43GE or 24382LU Solved! Go to
-
FireFox 7 does not obey no-cache headers?
When I ever I visit my site that sends no-cache headers, FireFox still caches it. It's really annoying in the Admin CP for my forums as it "seems" to make the settings go back, and the success message is not shown. It worked fine with FireFox 6.
-
i have Server 2008 r2 exchange 2010 evrything was working fine but now when i try to open the Exchange management console i get this errore the follwing error ocurred when serching for on premises exchange server Connecting to remote server failed wi