How to sort in report 6i ?
Hi all,
I got one query Q_1, whereby when query run it will give me the partno that found in table A. However, in Q_1, there is one calculation column, say QTY1, will be calculated and displayed in the layout with no problem.
Ok, how am I going to sort this field QTY1 ?? b'cos QTY1 is not in the query of Q_1 ? QTY1 is a formula column that created. How to go about it ?
Rgds
Lim
Hi,
In the Data Model, you can see your calculation column (QTY1) in the group (G_1) that belongs to the query Q_1. You can place the column QTY1 as first in the group G_1 and give the property 'Break Order' the value 'Ascending'.
In the Data Model you see a blue arrow (pointing up) in front of the column QTY1. When you choose the value 'Descending', the blue arrow will point down.
The group will then be sorted (asc or desc) on the column QTY1.
Kind regards,
Lennart de Vos
Similar Messages
-
How to Sort the report by clicking the column_header at runtime?
Hi,<br /><br />Im New to Crystal Reports.<br /><br />Im Using Crystal report server XI. and JSP<br /><br />I need to <strong>Sort</strong> the report by clicking the<strong> column_header</strong> at runtime.<br /><br />How to implement this ?<br /><br />Please help me.<br /><br />- Venkat.<br />
<p>Hi Venkat</p><p>I don't believe there is a way to do this out of the box. I believe you would have to do a custom code solution so that when you click on the header the report is re-run with a different sort order. This may not be that easy to implement.</p><p>I'm going to check with the new WebElements custom functions that were released on this site. They may provide for this functionality. <br /></p><p>Rob Horne<br /><a href="/blog/10">Rob's blog - http://diamond.businessobjects.com/blog/10</a></p>
-
Cisco Prime LMS 4.2, how to sort Uptime report?
Using an Inventory Custom Report, Uptime can be shown and it is nicely parsed out to be human readable. But how can I sort it to get the longest uptimes?
Thanks for any help,
Dave FaughtYou can select parameters, but LMS won't show you data sorted up, unfortunately.
But withing the report, you can click on the columt fields and it can sort the data for you, and later it can be exported to pdf or csv:
If your schedule the job, you can receive the data directly mailed as .csv, which again can be sorted easily. No option withing LMS to do it before report is generated.
-Thanks
Vinod
**Support Contributors. Rate them. ** -
How to sort weblayout active report
Hi Experts,
I have created some 'Active Reports' using Webl Layout Editor.
However, they are not looking very good.
I wanted to know how can I improve the look and feel of the generated reports? or at least how can I sort the reports?
Thanks!!!
RajendraSee Kyle's blog, read the comments:
http://blogs.oracle.com/kyle/2010/11/document_and_workflow_history.html
In the comments he has a component for sorting the reports. -
my 2009 macbookpro has begun running very slowly, apps freeze and pages hang ... i've run EtreCheck and there are problems but don't know how to sort ... ran CleanMyMac and freed up about 30GB of space but didn't help ... ran AdwareMedic so that's been sorted but the other issues that came up on the EtreCheck I need help with however i can't figure out how to paste the results on this page
thanks thomas ... here it comes
EtreCheck version: 2.1.5 (108)
Report generated December 29, 2014 at 5:03:07 PM GMT
Click the [Support] links for help with non-Apple products.
Click the [Details] links for more information about that line.
Click the [Adware] links for help removing adware.
Hardware Information: ℹ️
MacBook Pro (17-inch, Early 2009) (Verified)
MacBook Pro - model: MacBookPro5,2
1 2.66 GHz Intel Core 2 Duo CPU: 2-core
4 GB RAM Upgradeable
BANK 0/DIMM0
2 GB DDR3 1067 MHz ok
BANK 1/DIMM0
2 GB DDR3 1067 MHz ok
Bluetooth: Old - Handoff/Airdrop2 not supported
Wireless: en1: 802.11 a/b/g/n
Video Information: ℹ️
NVIDIA GeForce 9400M - VRAM: 256 MB
Color LCD 1920 x 1200
NVIDIA GeForce 9600M GT - VRAM: 512 MB
System Software: ℹ️
OS X 10.9.5 (13F34) - Uptime: 0:5:36
Disk Information: ℹ️
FUJITSU MHZ2320BH FFS G1 disk0 : (320.07 GB)
EFI (disk0s1) <not mounted> : 210 MB
[redacted]'s world too (disk0s2) / : 319.21 GB (30.39 GB free)
Recovery HD (disk0s3) <not mounted> [Recovery]: 650 MB
MATSHITADVD-R UJ-868
USB Information: ℹ️
Apple Inc. Built-in iSight
Apple Inc. iPhone
Logitech USB Receiver
Apple Inc. BRCM2046 Hub
Apple Inc. Bluetooth USB Host Controller
Apple, Inc. Apple Internal Keyboard / Trackpad
Apple Computer, Inc. IR Receiver
Configuration files: ℹ️
/etc/hosts - Count: 29 - Corrupt!
Gatekeeper: ℹ️
Mac App Store and identified developers
Kernel Extensions: ℹ️
/Library/Application Support/Roxio
[not loaded] com.roxio.TDIXController (1.7) [Support]
/System/Library/Extensions
[not loaded] com.kensington.mouseworks.iokit.KensingtonMouseDriver (3.0) [Support]
/System/Library/Extensions/KensingtonMouseDriver.kext/Contents/PlugIns
[not loaded] com.kensington.mouseworks.driver.ADBID32Mouse (3.0) [Support]
[not loaded] com.kensington.mouseworks.driver.ADBID32MouseX1 (3.0) [Support]
[not loaded] com.kensington.mouseworks.driver.ADBID4Mouse (3.0) [Support]
[not loaded] com.kensington.mouseworks.driver.ADBID4MouseX1 (3.0) [Support]
[not loaded] com.kensington.mouseworks.driver.KMWBluetoothHIDMouse (3.0) [Support]
[not loaded] com.kensington.mouseworks.driver.KMWBluetoothOldHIDMouse (3.0) [Support]
[not loaded] com.kensington.mouseworks.driver.KMWUSBHIDMouse (3.0) [Support]
[not loaded] com.kensington.mouseworks.driver.USBMouseX1 (3.0) [Support]
[not loaded] com.kensington.mouseworks.driver.VirtualMouse (3.0) [Support]
[not loaded] com.kensington.mouseworks.driver.VirtualMouseX1 (3.0) [Support]
[not loaded] com.kensington.mouseworks.iokit.KensingtonMouseDriverX1 (3.0) [Support]
Startup Items: ℹ️
AdobeVersionCueCS2: Path: /Library/StartupItems/AdobeVersionCueCS2
Firewall: Path: /Library/StartupItems/Firewall
RetroRun: Path: /Library/StartupItems/RetroRun
Startup items are obsolete in OS X Yosemite
Launch Agents: ℹ️
[not loaded] com.adobe.AAM.Updater-1.0.plist [Support]
[loaded] com.adobe.CS4ServiceManager.plist [Support]
[loaded] com.adobe.CS5ServiceManager.plist [Support]
[invalid?] com.oracle.java.Java-Updater.plist [Support]
Launch Daemons: ℹ️
[loaded] com.adobe.fpsaud.plist [Support]
[invalid?] com.adobe.SwitchBoard.plist [Support]
[loaded] com.adobe.versioncueCS3.plist [Support]
[loaded] com.adobe.versioncueCS4.plist [Support]
[running] com.atomicbird.macaroni.launchd.plist [Support]
[loaded] com.macpaw.CleanMyMac2.Agent.plist [Support]
[invalid?] com.oracle.java.Helper-Tool.plist [Support]
[loaded] com.prosofteng.DriveGenius.locum.plist [Support]
[loaded] com.skype.skypeinstaller.plist [Support]
User Launch Agents: ℹ️
[loaded] com.adobe.AAM.Updater-1.0.plist [Support]
[loaded] com.adobe.ARM.[...].plist [Support]
[loaded] com.adobe.ARM.[...].plist [Support]
[loaded] com.google.keystone.agent.plist [Support]
[loaded] com.macpaw.CleanMyMac2Helper.diskSpaceWatcher.plist [Support]
[loaded] com.macpaw.CleanMyMac2Helper.scheduledScan.plist [Support]
[loaded] com.macpaw.CleanMyMac2Helper.trashWatcher.plist [Support]
[running] com.prosofteng.DGMonitor.plist [Support]
[running] ws.agile.1PasswordAgent.plist [Support]
User Login Items: ℹ️
CNQL1210_ButtonManager ApplicationHidden (/Library/CFMSupport/CNQL1210_ButtonManager.app)
System Events ApplicationHidden (/System/Library/CoreServices/System Events.app)
Mail Application (/Applications/Mail.app)
Firefox Application (/Applications/Firefox.app)
AdobeResourceSynchronizer ApplicationHidden (/Applications/Adobe Reader 9/Adobe Reader.app/Contents/Support/AdobeResourceSynchronizer.app)
Calendar Application (/Applications/Calendar.app)
Skype Application (/Applications/Skype.app)
Dropbox Application (/Applications/Dropbox.app)
AdobeResourceSynchronizer ApplicationHidden (/Applications/Adobe Reader.app/Contents/Support/AdobeResourceSynchronizer.app)
MouseWorks Background Application (/Library/Application Support/Kensington/MouseWorks.prefPane/Contents/Resources/Support/MouseWorks Background.app)
Internet Plug-ins: ℹ️
AdobePDFViewerNPAPI: Version: 11.0.10 - SDK 10.6 [Support]
Flash Player: Version: 16.0.0.235 - SDK 10.6 [Support]
EPPEX Plugin: Version: 3.0.0.0 [Support]
AdobePDFViewer: Version: 11.0.10 - SDK 10.6 [Support]
ContentUploaderPlugin: Version: 1.2 [Support]
iPhotoPhotocast: Version: 7.0
RealPlayer Plugin: Version: Unknown [Support]
PDEPrint: Version: 2.0 [Support]
DirectorShockwave: Version: 11.5.2r602 [Support]
PDF Browser Plugin: Version: 2.4.2 - SDK 10.2 [Support]
FlashPlayer-10.6: Version: 16.0.0.235 - SDK 10.6 [Support]
QuickTime Plugin: Version: 7.7.3
CANONiMAGEGATEWAYDL: Version: 3.0.0.2 [Support]
DivXBrowserPlugin: Version: 1.3 [Support]
Silverlight: Version: 5.1.30514.0 - SDK 10.6 [Support]
Google Earth Web Plug-in: Version: 6.0 [Support]
Default Browser: Version: 537 - SDK 10.9
Flip4Mac WMV Plugin: Version: 3.2.0.16 - SDK 10.8 [Support]
JavaAppletPlugin: Version: 14.9.0 - SDK 10.7 Check version
OfficeLiveBrowserPlugin: Version: 12.3.6 [Support]
User internet Plug-ins: ℹ️
QuickTime Plugin: Version: 6.5.1
fbplugin_1_0_0: Version: Unknown [Support]
Safari Extensions: ℹ️
Ultimate [Installed]
3rd Party Preference Panes: ℹ️
ASM [Support]
DivX [Support]
Flash Player [Support]
Flip4Mac WMV [Support]
Macaroni [Support]
Time Machine: ℹ️
Skip System Files: NO
Mobile backups: OFF
Auto backup: NO - Auto backup turned off
Destinations:
G-DRIVE Mini [Local]
Total size: 999.86 GB
Total number of backups: 7
Oldest backup: 2014-07-09 00:13:07 +0000
Last backup: 2014-12-10 22:18:57 +0000
Size of backup disk: Excellent
Backup size 999.86 GB > (Disk size 0 B X 3)
Top Processes by CPU: ℹ️
6% WindowServer
3% firefox
1% mds_stores
0% mdworker
0% Skype
Top Processes by Memory: ℹ️
348 MB firefox
137 MB Skype
122 MB mds_stores
120 MB com.apple.IconServicesAgent
73 MB Dropbox
Virtual Memory Information: ℹ️
1.26 GB Free RAM
1.74 GB Active RAM
477 MB Inactive RAM
543 MB Wired RAM
503 MB Page-ins
0 B Page-outs
Diagnostics Information: ℹ️
Dec 29, 2014, 04:58:09 PM Self test - passed
Dec 29, 2014, 10:58:04 AM /Library/Logs/DiagnosticReports/Keychain Access_2014-12-29-105804_[redacted].hang
Dec 29, 2014, 10:54:33 AM /Library/Logs/DiagnosticReports/Keychain Access_2014-12-29-105433_[redacted].hang
Dec 29, 2014, 10:52:33 AM /Library/Logs/DiagnosticReports/Keychain Access_2014-12-29-105233_[redacted].hang
Dec 29, 2014, 10:50:24 AM /Library/Logs/DiagnosticReports/Keychain Access_2014-12-29-105024_[redacted].hang
Dec 29, 2014, 10:50:24 AM /Library/Logs/DiagnosticReports/Skype_2014-12-29-105024_[redacted].hang -
How to Created custom report for Ship not Billed (SD/FI)?
Hi all,
I am anticipating to write some abap reports..Here is one of them..
Anyone can help me with writing a Report , how to do 'Custom Report for shipped not Billed(SD/FI)' ..But since I am new to Abap , if you wish to reply, please use a little more detail and simple explanation, step by step so I can understand what is the idea, how it can be acheived...what kind of report should be used , techniques, tables etc...:)
Appreciate your help!
Regards,
BobyHi Boby,
You need to create custom transaction to achive these results.
you will have selection-screen ,it would be :
Date : Here date would be mandatory - Ranges Option
Customer - Optional field - Ranges
Order # Sales Order (Optional) Ranges
Invoice # - Invoice # (Optional) Ranges
You will get the data based on ur selection-screen criteria ...
First you will have customer order details from diffrent table
VBAK,
VBAP,
LIKP
LIPS
VBRK,
VBRP
KNA1,
VBFA Tables ( See the my sample program )
Output would be :
Customer # Custome Name Order # Delivery # Invoice # Netpr, Netquantity ,
Check the condition whether invoice table has VBRK-RFBSK = ''.
See the my sample program : This is sales report by monthly..
REPORT ZFDSALES_REPORT no standard page heading
message-id zwave.
Data Declaration Part
TYPE-POOLS
type-pools : slis.
Tables
tables : VBAK,
VBAP.
Internal table for VBAK Table
data : begin of i_vbak occurs 0,
vbeln like vbak-vbeln,
bstnk like vbak-bstnk,
vdatu like vbak-vdatu,
end of i_vbak.
Internal table for VBAP and MATNR
data : begin of i_vbap occurs 0,
vbeln like vbap-vbeln,
matnr like vbap-matnr,
kdmat like vbap-kdmat,
kwmeng like vbap-kwmeng,
netpr like vbap-netpr,
maktx like makt-maktx,
end of i_vbap.
Internal tables
data : begin of i_sales occurs 0,
vdatu like vbak-vdatu,
bstnk like vbak-bstnk,
matnr like vbap-matnr,
maktx like makt-maktx,
kdmat like vbap-kdmat,
kwmeng like vbap-kwmeng,
netpr like vbap-netpr,
end of i_sales.
Variable for ALV
data : v_repid like sy-repid,
gt_fieldcat type slis_t_fieldcat_alv.
Selection-screen
selection-screen : begin of block blk with frame title text-001.
select-options : s_vbeln for vbak-vbeln,
s_erdat for vbak-erdat,
s_ernam for vbak-ernam,
s_vdatu for vbak-vdatu obligatory,
s_BSTNK for vbak-BSTNK,
s_KUNNR for vbak-kunnr,
s_matnr for vbap-matnr,
s_KDMAT for vbap-KDMAT.
selection-screen : end of block blk.
Initilization
initialization.
v_repid = sy-repid.
S T A R T - O F - S E L E C T I O N ****************
start-of-selection.
Get the data from VBAK and VBAP Tables
perform get_vbak_vbap.
E N D - O F - S E L E C T I O N *****************
end-of-selection.
Display the data
perform dispolay_data.
*& Form get_vbak_vbap
Get the data from VBAK and VBAP Table
FORM get_vbak_vbap.
Get the data from VBAK Table
select vbeln bstnk vdatu from vbak into table i_vbak
where vbeln in s_vbeln
and bstnk in s_bstnk
and vdatu in s_vdatu
and kunnr in s_kunnr
and erdat in s_erdat
and ernam in s_ernam.
if sy-subrc ne 0.
message e000(zwave) with 'No data found for given selection'.
endif.
Get the data from VBAP Table
select avbeln amatnr akdmat akwmeng a~netpr
b~maktx into table i_vbap
from vbap as a inner join makt as b on bmatnr = amatnr
for all entries in i_vbak
where a~vbeln in s_vbeln
and a~kdmat in s_kdmat
and a~abgru = space
and a~matnr in s_matnr
and a~matnr ne '000000000000009999'
and a~matnr ne '000000000000004444'
and a~matnr ne '000000000000008888'
and a~matnr ne '000000000000001111'
and a~werks = '1000'
and b~spras = 'E'
and a~vbeln = i_vbak-vbeln.
if sy-subrc ne 0.
message e000(zwave) with 'No data found for given selection'.
endif.
sort i_vbak by vbeln.
sort i_vbap by vbeln matnr.
loop at i_vbap.
read table i_vbak with key vbeln = i_vbap-vbeln
binary search.
if sy-subrc eq 0.
i_sales-bstnk = i_vbak-bstnk.
i_sales-vdatu = i_vbak-vdatu.
i_sales-matnr = i_vbap-matnr.
i_sales-kdmat = i_vbap-kdmat.
i_sales-maktx = i_vbap-maktx.
i_sales-netpr = i_vbap-netpr.
i_sales-kwmeng = i_vbap-kwmeng.
append i_sales.
else.
continue.
endif.
clear : i_sales,
i_vbap,
i_vbak.
endloop.
sort i_sales by vdatu bstnk matnr.
refresh : i_vbap,
i_vbak.
ENDFORM. " get_vbak_vbap
*& Form dispolay_data
Display the data
FORM dispolay_data.
Fill the Fiedlcat
PERFORM fieldcat_init using gt_fieldcat[].
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = v_repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT =
IT_FIELDCAT = gt_fieldcat[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IT_ALV_GRAPHICS =
IT_ADD_FIELDCAT =
IT_HYPERLINK =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IT_EXCEPT_QINFO =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = i_sales
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
ENDFORM. " dispolay_data
*& Form fieldcat_init
text
-->P_GT_FIELDCAT[] text
FORM fieldcat_init USING e01_lt_fieldcat type slis_t_fieldcat_alv.
DATA: LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
Delivery Date
CLEAR LS_FIELDCAT.
LS_FIELDCAT-FIELDNAME = 'VDATU'.
LS_FIELDCAT-OUTPUTLEN = 12.
LS_FIELDCAT-TABNAME = 'I_SALES'.
ls_fieldcat-seltext_L = 'Delivery Date'.
APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
Purchase Order #Material Description
CLEAR LS_FIELDCAT.
LS_FIELDCAT-FIELDNAME = 'BSTNK'.
LS_FIELDCAT-OUTPUTLEN = 25.
LS_FIELDCAT-TABNAME = 'I_SALES'.
ls_fieldcat-seltext_L = 'Purchase Order #'.
APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
Material
CLEAR LS_FIELDCAT.
LS_FIELDCAT-REF_FIELDNAME = 'MATNR'.
LS_FIELDCAT-REF_TABNAME = 'MARA'.
LS_FIELDCAT-FIELDNAME = 'MATNR'.
LS_FIELDCAT-TABNAME = 'I_SALES'.
ls_fieldcat-seltext_L = 'Material #'.
ls_fieldcat-seltext_M = 'Material #'.
ls_fieldcat-seltext_S = 'Material #'.
APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
Material Description
CLEAR LS_FIELDCAT.
LS_FIELDCAT-FIELDNAME = 'MAKTX'.
LS_FIELDCAT-OUTPUTLEN = 40.
LS_FIELDCAT-TABNAME = 'I_SALES'.
ls_fieldcat-seltext_L = 'Material Description'.
APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
Customer Material #
CLEAR LS_FIELDCAT.
LS_FIELDCAT-FIELDNAME = 'KDMAT'.
LS_FIELDCAT-OUTPUTLEN = 35.
LS_FIELDCAT-TABNAME = 'I_SALES'.
ls_fieldcat-seltext_L = 'Customer material no.'.
APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
Quantity
CLEAR LS_FIELDCAT.
LS_FIELDCAT-FIELDNAME = 'KWMENG'.
LS_FIELDCAT-OUTPUTLEN = 15.
LS_FIELDCAT-TABNAME = 'I_SALES'.
ls_fieldcat-seltext_L = 'Quantity'.
APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
Net Price
CLEAR LS_FIELDCAT.
LS_FIELDCAT-FIELDNAME = 'NETPR'.
LS_FIELDCAT-OUTPUTLEN = 15.
LS_FIELDCAT-TABNAME = 'I_SALES'.
ls_fieldcat-seltext_L = 'Net Price'.
APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
ENDFORM. " fieldcat_init
Reward Points if it is helpful
Thanks
Seshu -
How to sort file which is created in background......
Hi All,
I have executed ALV report in background and it is generated, But after generating the report comes in ALV LIST display. how to sort field of ALV List which is generated in background ?
YusufSolved
-
Hello Experts,
Could you please help me? Is there a way to sort Oracle report by formula column? We selecting some columns in the report and one of the columns is a complicated select from different tables returning value. We want to sort the report by this column. How to do that?
Thanks for your help.
YashHello,
You can move the formula column at the top of the query and the select its Break Order property(more on this in Reports Builder Help Contents).
Regards,
Alex
If someone's answer is helpful or correct please mark it accordingly. -
How to sort Data in XML template (rtf) file?
Hi, I have an oracle 11i custom report (rdf) with an xml output to a PDF. There is a formula column in the report. Now I need the data to be sorted on this formula column. As we cannot sort on formula column, i have decided to find a way to sort it in the data in the XML template. But I don't really know how to sort and also where to specify the sort tag in the rtf file. I appreciate your response.
Databse version : 9.2.0.8.0
E-Biz Version : 11.5.10.2
Oracle Reports Version : 6.0.8.27.0
Oracle BI version : 10.1.3.2.1
Note : I posted this question under : XML General forum also. But did not get any response. I assumed that may be thats not the right place to post it as my report is in e-Biz environment.Hi
As long as you don't have your ^field commands grouped inside a ^group the order in the .dat file is not important. Your last command
^field BG_DOC_LN__LN_AM
246624.12
should populate field BG_DOC_LN_AM wherever you place it on your form. Obviously you need to name the fields according to your ^field commands and not just use tab (move to next field).
Shout if this was not what you are asking.
Stale Sodal -
How to Sort Dimension in Pivot Table via Order Column which is changing like Factual values
Hi,
Recently in of our product offerings we got stuck on this following question:
How to Sort Dimension based on the Order Value which Keeps Changing with Factual Values??
We have a data source laid out as (example)
In the above the “Order” columns are changing per
Company/(DimensionA) for DimesnsionB.
Instead what we want is: (But only if we can get the following result without putting the “Order” Column in the “Values” Section.
If there are any configurations that we can make to our power pivot model for the similar data set so that the
DimesnionB in this case can be sorted by the Order column, would be greatly helpful to us.
Sample File:
http://tms.managility.com.au/query_example.xlsx
Thanks
AmolHi Amol,
According to your description, you need to sort dimension members in Pivot Table via order column, and you don't want the order column show on the Pivot table, right?
Based on my research, we can sort the data on the Pivot table based on one of the columns in that table, and we cannot sort the data based on the columns that not existed on the Pivot table. So in your scenario, to achieve your requirement, you can
add the column to pivot table and hide it.
https://support.office.com/en-gb/article/Sort-data-in-a-PivotTable-or-a-PivotChart-report-49efc50a-c8d9-4d34-a254-632794ff1e6e
Regards,
Charlie Liao
TechNet Community Support -
hi
how to develo a report that displays vendor , porder and material details.Hi
See the sample report using LFA1,EKKO,EKPO tables Modify as per your requirement
*& Report ZMM_PO_REPORT
REPORT ZMM_PO_REPORT message-Id yb
NO STANDARD PAGE HEADING
LINE-COUNT 60(1)
LINE-SIZE 230.
D A T A B A S E T A B L E S D E C L A R A T I O N
TABLES: lfa1, " Vendor Master
t161, " PO Doc Types
t024, " Purchase Groups
ekko. " PO Header
T Y P E S D E C L A R A T I O N S
Purchase Orders Main Structure
TYPES: BEGIN OF s_po,
ebeln TYPE ebeln, " PO No.
ebelp TYPE ebelp, " PO Item
bstyp TYPE bstyp, " PO Category
bukrs TYPE bukrs, " Company Code
bsart TYPE bbsrt, " PO Type
lifnr TYPE lifnr, " Vendor No
ekgrp TYPE bkgrp, " Purchase Group
waers TYPE waers, " Currency
bedat TYPE etbdt, " PO Date
txz01 TYPE txz01, " Material Text
werks TYPE ewerk, " Plant
lgort TYPE lgort_d, " Storage Location
matkl TYPE matkl, " Material Group
menge TYPE bamng, " PR Quantity
meins TYPE bamei, " UOM
bprme TYPE bbprm, " Price Unit
netpr TYPE netpr, " Net price
peinh TYPE peinh, " Price Unit UOM
pstyp TYPE pstyp, " Item Category
knttp TYPE knttp, " Account Assignment Category
END OF s_po.
Purchase Orders History Structure
TYPES: BEGIN OF s_account,
ebeln TYPE ebeln, " PO No.
ebelp TYPE ebelp, " PO Item
gjahr TYPE mjahr, " Fiscal Year
belnr TYPE mblnr, " PO Invoice No
menge TYPE menge_d, " PR Quantity
wrbtr TYPE wrbtr, " Price in Local Currency
dmbtr TYPE dmbtr, " Price in Foreign Currency
waers TYPE waers, " Currency
shkzg TYPE shkzg, " Dr/Cr Indicator
END OF s_account.
Purchase Orders History Structure(Item Sum)
TYPES: BEGIN OF s_inv_sum,
ebeln TYPE ebeln, " PO No.
ebelp TYPE ebelp, " PO Item
menge TYPE menge_d, " PR Quantity
wrbtr TYPE wrbtr, " Price in Foreign Currency
waers TYPE waers, " Currency
END OF s_inv_sum.
Purchase Orders Main Structure
TYPES: BEGIN OF s_rep,
lifnr TYPE lifnr, " Vendor No
ebeln TYPE ebeln, " PO No.
ebelp TYPE ebelp, " PO Item
bstyp TYPE bstyp, " PO Category
bsart TYPE bbsrt, " PO Type
ekgrp TYPE bkgrp, " Purchase Group
waers TYPE waers, " Currency
bedat TYPE etbdt, " PO Date
txz01 TYPE txz01, " Material Text
werks TYPE ewerk, " Plant
lgort TYPE lgort_d, " Storage Location
matkl TYPE matkl, " Material Group
menge TYPE bamng, " PR Quantity
meins TYPE bamei, " UOM
bprme TYPE bbprm, " Price Unit
netpr TYPE netpr, " Net price
peinh TYPE peinh, " Price Unit UOM
pstyp TYPE pstyp, " Item Category
knttp TYPE knttp, " Account Assignment Category
name1 TYPE name1, " Plant
orewr TYPE netpr, " To be Invoiced Price
curr TYPE waers, " Inv Doc Currency
END OF s_rep.
D A T A D E C L A R A T I O N S
DATA: gv_title1 TYPE sylisel, " Report title
gv_dial. " Color flag
C O N S T A N T S D E C L A R A T I O N S
CONSTANTS: c_x VALUE 'X', " Flag X
c_h VALUE 'H', " Debit
c_vgabe TYPE vgabe VALUE '2'. " Transaction Type
I N T E R N A L T A B L E S D E C L A R A T I O N S
DATA: i_po TYPE STANDARD TABLE OF s_po WITH HEADER LINE,
" Purchase Order
i_inv TYPE STANDARD TABLE OF s_inv_sum WITH HEADER LINE,
" PO Invoice Values
i_rep TYPE STANDARD TABLE OF s_rep WITH HEADER LINE,
" PO Invoice Values
i_ekbe TYPE STANDARD TABLE OF s_account WITH HEADER LINE.
" PO Invoice Values
S E L E C T I O N S C R E E N *
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: s_lifnr FOR lfa1-lifnr MATCHCODE OBJECT kred,
s_ebeln FOR ekko-ebeln MATCHCODE OBJECT mekk,
s_bsart FOR t161-bsart,
s_ekgrp FOR t024-ekgrp,
s_bedat FOR ekko-bedat.
SELECTION-SCREEN END OF BLOCK b1.
I N I T I A L I Z A T I O N *
INITIALIZATION.
A T S E L E C T I O N - S C R E E N *
AT SELECTION-SCREEN.
Validate the screen fields
PERFORM validate_screen.
S T A R T - O F - S E L E C T I O N *
START-OF-SELECTION.
Fetch main data
PERFORM fetch_data.
T O P - O F - P A G E *
TOP-OF-PAGE.
Header of the List
PERFORM header.
E N D - O F - P A G E *
Footer
END-OF-PAGE.
ULINE.
E N D - O F - S E L E C T I O N *
END-OF-SELECTION.
Display the Report Output data
PERFORM display_data.
At Line-Selection
AT LINE-SELECTION.
When double clicked on EBELN display the details of Purchase Doc
PERFORM line_sel.
*& Form validate_screen
Validation of Selection Screen fields
FORM validate_screen .
Validation of Vendor Number
CLEAR lfa1-lifnr.
IF NOT s_lifnr[] IS INITIAL.
SELECT lifnr UP TO 1 ROWS
INTO lfa1-lifnr
FROM lfa1
WHERE lifnr IN s_lifnr.
ENDSELECT.
IF sy-subrc <> 0.
MESSAGE e000 WITH 'Invalid Vendor'(002).
ENDIF.
ENDIF.
Validation of PO Number
CLEAR ekko-ebeln.
IF NOT s_ebeln[] IS INITIAL.
SELECT ebeln UP TO 1 ROWS
INTO ekko-ebeln
FROM ekko
WHERE ebeln IN s_ebeln.
ENDSELECT.
IF sy-subrc <> 0.
MESSAGE e000 WITH 'Invalid Document Number'(003).
ENDIF.
ENDIF.
Validation of PO Document Type
CLEAR t161-bsart.
IF NOT s_bsart[] IS INITIAL.
SELECT bsart UP TO 1 ROWS
INTO t161-bsart
FROM t161
WHERE bsart IN s_bsart.
ENDSELECT.
IF sy-subrc <> 0.
MESSAGE e000 WITH 'Invalid Purchase Document Type'(004).
ENDIF.
ENDIF.
Validation of Purchasing Group
CLEAR t024-ekgrp.
IF NOT s_ekgrp[] IS INITIAL.
SELECT ekgrp UP TO 1 ROWS
INTO t024-ekgrp
FROM t024
WHERE ekgrp IN s_ekgrp.
ENDSELECT.
IF sy-subrc <> 0.
MESSAGE e000 WITH 'Invalid Purchasing Group'(005).
ENDIF.
ENDIF.
ENDFORM. " validate_screen
*& Form fetch_data
Fetching the PO related data from Database Tables
FORM fetch_data .
CLEAR i_po.
REFRESH i_po.
SELECT a~ebeln " PO No.
b~ebelp " PO Item
a~bstyp " PO Category
a~bukrs " Company Code
a~bsart " PO Type
a~lifnr " Vendor No
a~ekgrp " Purchase Group
a~waers " Currency
a~bedat " PO Date
b~txz01 " Material Text
b~werks " Plant
b~lgort " Storage Location
b~matkl " Material Group
b~menge " PR Quantity
b~meins " UOM
b~bprme " Price Unit
b~netpr " Net price
b~peinh " Price Unit UOM
b~pstyp " Item Category
b~knttp " Account Assignment Category
INTO TABLE i_po
FROM ekko AS a JOIN ekpo AS b
ON a~ebeln = b~ebeln
WHERE a~ebeln IN s_ebeln AND
a~lifnr IN s_lifnr AND
a~ekgrp IN s_ekgrp AND
a~bsart IN s_bsart AND
a~bedat IN s_bedat.
SORT i_po BY ebeln ebelp.
break-point.
IF NOT i_po[] IS INITIAL.
Fetch the PO History/Invoice Details from EKBE Table
CLEAR i_ekbe.
REFRESH i_ekbe.
SELECT ebeln " PO No.
ebelp " PO Item
gjahr " Fiscal Year
belnr " PO Invoice No
menge " PR Quantity
wrbtr " Price in Local Currency
dmbtr " Price in Foreign Currency
waers " Currency
shkzg " Dr/Cr Indicator
INTO TABLE i_ekbe
FROM ekbe
FOR ALL ENTRIES IN i_po
WHERE ebeln = i_po-ebeln AND
ebelp = i_po-ebelp AND
vgabe = c_vgabe.
break-point.
IF sy-subrc = 0.
SORT i_ekbe BY ebeln ebelp.
LOOP AT i_ekbe.
IF i_ekbe-shkzg = c_h.
i_ekbe-wrbtr = i_ekbe-wrbtr * -1.
ENDIF.
MODIFY i_ekbe.
ENDLOOP.
break-point.
Sum up the Item wise Invoice totals
LOOP AT i_ekbe.
AT END OF ebelp.
READ TABLE i_ekbe INDEX sy-tabix.
SUM.
MOVE-CORRESPONDING i_ekbe TO i_inv.
APPEND i_inv.
ENDAT.
CLEAR i_inv.
ENDLOOP.
SORT i_inv BY ebeln ebelp.
break-point.
ENDIF.
ENDIF.
Move the Vendor Name and Invoice Values to I_rep Internal Table
LOOP AT i_po.
MOVE-CORRESPONDING i_po TO i_rep.
CLEAR i_inv.
READ TABLE i_inv WITH KEY ebeln = i_po-ebeln
ebelp = i_po-ebelp.
IF sy-subrc = 0.
i_rep-orewr = ( i_po-menge - i_inv-menge ) * i_po-netpr.
i_rep-curr = i_inv-waers.
ELSE.
i_rep-orewr = i_po-menge * i_po-netpr.
i_rep-curr = i_po-waers.
ENDIF.
break-point.
Get the Vendor Name
CLEAR lfa1-name1.
SELECT SINGLE name1 FROM lfa1 INTO lfa1-name1
WHERE lifnr = i_po-lifnr.
IF sy-subrc = 0.
i_rep-name1 = lfa1-name1.
ENDIF.
APPEND i_rep.
CLEAR i_rep.
break-point.
ENDLOOP.
SORT i_rep BY lifnr ebeln ebelp.
DELETE i_rep WHERE orewr LE 0.
break-point.
ENDFORM. " fetch_data
*& Form display_data
Display the Report Output data
FORM display_data .
DATA: lv_flag, " New Flag
lv_rec TYPE i. " No of Records
CLEAR lv_rec.
IF i_rep[] IS INITIAL.
MESSAGE e000 WITH 'No Data found'(022).
ELSE.
LOOP AT i_rep.
Toggle Color
PERFORM toggle_color.
IF lv_flag <> space.
NEW-LINE.
ENDIF.
At New Purchase Document
AT NEW ebeln.
WRITE:/1 sy-vline, 2(10) i_rep-ebeln INTENSIFIED OFF.
lv_flag = c_x.
lv_rec = lv_rec + 1.
ENDAT.
WRITE: 1 sy-vline,
12 sy-vline,13(4) i_rep-bsart,
17 sy-vline,18(10) i_rep-lifnr,
28 sy-vline,29(35) i_rep-name1,
64 sy-vline,65(4) i_rep-ekgrp,
69 sy-vline,70(10) i_rep-bedat,
80 sy-vline,81(5) i_rep-ebelp,
86 sy-vline,87(40) i_rep-txz01,
127 sy-vline,128(9) i_rep-matkl,
137 sy-vline,138(1) i_rep-pstyp,
139 sy-vline,140(1) i_rep-knttp,
141 sy-vline,142(4) i_rep-werks,
146 sy-vline,147(4) i_rep-lgort,
151 sy-vline,152(13) i_rep-menge UNIT i_rep-meins,
165 sy-vline,166(3) i_rep-meins,
169 sy-vline,170(15) i_rep-netpr CURRENCY i_rep-waers,
185 sy-vline,186(4) i_rep-waers,
190 sy-vline,191(5) i_rep-peinh,
196 sy-vline,197(4) i_rep-bprme,
201 sy-vline,202(15) i_rep-orewr CURRENCY i_rep-curr,
217 sy-vline,218(4) i_rep-curr,
222 sy-vline,223(7) i_rep-bstyp centered,
230 sy-vline.
NEW-LINE.
hide: i_rep-ebeln.
ENDLOOP.
ULINE.
FORMAT COLOR OFF.
WRITE : /2 'Total Number of Purchasing Documents:'(025) COLOR 3,
lv_rec COLOR 3.
ENDIF.
ENDFORM. " display_data
*& Form header
Write the Report Header
FORM header .
FORMAT RESET.
header
WRITE:/1(230) 'LIST OF PURCHASE DOCUMENTS PER VENDOR'(006) CENTERED.
SKIP.
FORMAT COLOR COL_HEADING.
ULINE.
WRITE:/1 sy-vline,2(10) 'Pur.Doc.No'(006) CENTERED,
12 sy-vline,13(4) 'Type'(007),
17 sy-vline,18(10) 'Vendor'(008) CENTERED,
28 sy-vline,29(35) 'Name'(009) CENTERED,
64 sy-vline,65(4) 'PGrp'(010) CENTERED,
69 sy-vline,70(10) 'Doc.Date'(012) CENTERED,
80 sy-vline,81(5) 'Item'(011),
86 sy-vline,87(40) 'Material Short Text'(024) CENTERED,
127 sy-vline,128(9) 'Mat.Group'(013),
137 sy-vline,138(1) 'I',
139 sy-vline,140(1) 'A',
141 sy-vline,142(4) 'Plnt'(014),
146 sy-vline,147(4) 'SLoc'(015),
151 sy-vline,152(13) 'Quantity'(016) CENTERED,
165 sy-vline,166(3) 'UoM'(017),
169 sy-vline,170(15) 'Net Value'(018) CENTERED,
185 sy-vline,186(4) 'Curr'(019),
190 sy-vline,191(5) 'Per'(020),
196 sy-vline,197(4) 'Unit'(021),
201 sy-vline,202(15) 'To be Invoiced'(023) CENTERED,
217 sy-vline,218(4) 'Curr'(019),
222 sy-vline,223(7) 'Doc.Cat'(026),
230 sy-vline.
ULINE.
ENDFORM. " header
*& Form toggle_color
This routine alters the color of the records in the list
FORM toggle_color.
IF gv_dial = space.
FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
gv_dial = c_x.
ELSE.
FORMAT COLOR 1 INTENSIFIED OFF.
CLEAR gv_dial.
ENDIF.
ENDFORM. " toggle_color
*& Form LINE_SEL
*When double clicked on EBELN field display the details of Purchase Doc
FORM line_sel.
CASE sy-lsind.
WHEN '1'.
DATA: lv_field(20),
lv_value(10),
lv_bstyp like i_rep-bstyp.
clear: lv_bstyp,lv_value, lv_field.
GET CURSOR FIELD lv_field VALUE lv_value.
IF lv_field = 'I_REP-EBELN'.
IF NOT lv_value IS INITIAL.
READ LINE sy-index FIELD VALUE i_rep-bstyp
INTO lv_bstyp.
READ CURRENT LINE FIELD VALUE i_rep-bstyp INTO lv_bstyp.
if lv_bstyp = 'F'.
SET PARAMETER ID 'BES' FIELD lv_value.
CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
elseif ( lv_bstyp = 'K' or lv_bstyp = 'L' ).
SET PARAMETER ID 'VRT' FIELD lv_value.
CALL TRANSACTION 'ME33' AND SKIP FIRST SCREEN.
elseif lv_bstyp = 'A'.
SET PARAMETER ID 'ANF' FIELD lv_value.
CALL TRANSACTION 'ME43' AND SKIP FIRST SCREEN.
endif.
ENDIF.
ENDIF.
ENDCASE.
ENDFORM. " line_sel
<b>Reward points for useful Answers</b>
Regards
Anji -
How to sort via multi value parameter in ssrs
I have a parameter with multi values. when the user selects ,he get of options like acount name, first name, last name.
so if user selects firstname , the data has to sort by firstname.
if he selects acount name , the data has to sort by account name.
please help me how to sort the data using parameter with multivalue? in ssrs 2008.
Thank you?Hi Venku,
Based on your description, it seems that you create a parameter with available values and you want to sort the report data based on the parameter value. If the available values are the field names in the report, you can try to open the Tablix properties
dialog box and specify the sort expression on "Sorting" tab as follows:
=Fields(Parameter!parametername.value).value
If the parameter allow multiple values and you want to sort the report data by more than one field, for example, sort the report data by "accountname" and then by "firstname", please add two sort expressions as follows:
=Fields(Parameter!parametername.value(0)).value
=Fields(Parameter!parametername.value(1)).value
If you have any question, please let me know.
Regards,
Fanny Liu
Fanny Liu
TechNet Community Support -
what is the process to sort in alvs report the output is in decending and accending order without using standard buttenens in the output list .
i am asking how to sort bydefault when we are executing the report ,
output list will automatically in sort order.
could u plz explalin clearly with comments
and codeHi
Add this to your alv reporting
Add Default Sorting to ALVgrid report
In order to display an ALV report with specific columns already sorted by default you will need to build a
sort catalogue. This is fairly straight forward and is done in the following way:
Step 1. Add data declaration for sort catalogue
Step 2. Add code to build sort catalogue table
Step 3. Update 'REUSE_ALV_GRID_DISPLAY' FM call to include parameter 'it_sort'
ALV data declarations
data: it_sortcat type slis_sortinfo_alv occurs 1,
wa_sort like line of it_sortcat.
perform build_sortcat.
*& Form build_sortcat
Build Sort catalog
FORM build_sortcat .
wa_sort-spos = 1.
wa_sort-fieldname = 'EBELN'.
gd_sortcat-tabname
APPEND wa_sort TO it_sortcat.
wa_sort-spos = 2.
wa_sort-fieldname = 'EBELP'.
gd_sortcat-tabname
APPEND wa_sort TO it_sortcat.
ENDFORM. " build_sortcat
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
i_callback_top_of_page = 'TOP-OF-PAGE'
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
it_sort = it_sortcat
i_save = 'X'
tables
t_outtab = it_ekko
exceptions
program_error = 1
others = 2.
Thanks
Shiva -
How to create custom reports.
Hi ,
Could you please let us know how to create custom reports which are data based and not analytics. Which is the best method , is it to devlop reports in sites or integrate with OBIEE reports. could you please let us know the best practices for this approach.
Thank you,
Sashank P.Hi Jiri ,
Thanks a lot for your support. Below are my answers for the request:
1) what data you want to report on? Is it data from a database? file system? Web service outputs?
Ans : The Data would be mostly from Database only.
2) what is the overall purpose of your solution?
Ans: The overall purpose of this solution is to generate reports with sorting capability and should be able to export in different format documents.
3) what is your architecture?
Ans :
4) why Sites?
Ans: The customers login into our site and can be able to view the different reports and the present site is already a webcenter site. and the reporting capability is an enhancement .
Can you please provide the right approach here. We have an option of using ADF or even we can use Webcenter Portals. So which would be the best approach to go. And can you please guide us any approach or examples for integrating Webcenter Portals and Sites and even integrating ADf with Sites.
Thank you,
Sashank P. -
How to create a report based on a DataSet programatically
I'm working on a CR 2008 Add-in.
Usage of this add-in is: Let the user choose from a list of predefined datasets, and create a totally empty report with this dataset attached to is. So the user can create a report based on this dataset.
I have a dataset in memory, and want to create a new report in cr2008.
The new report is a blank report (with no connection information).
If I set the ReportDocument.SetDataSource(Dataset dataSet) property, I get the error:
The report has no tables.
So I must programmatically define the table definition in my blank report.
I found the following article: https://boc.sdn.sap.com/node/869, and came up with something like this:
internal class NewReportWorker : Worker
public NewReportWorker(string reportFileName)
: base(reportFileName)
public override void Process()
DatabaseController databaseController = ClientDoc.DatabaseController;
Table table = new Table();
string tabelName = "Table140";
table.Name = tabelName;
table.Alias = tabelName;
table.QualifiedName = tabelName;
table.Description = tabelName;
var fields = new Fields();
var dbField = new DBField();
var fieldName = "ID";
dbField.Description = fieldName;
dbField.HeadingText = fieldName;
dbField.Name = fieldName;
dbField.Type = CrFieldValueTypeEnum.crFieldValueTypeInt64sField;
fields.Add(dbField);
dbField = new DBField();
fieldName = "IDLEGITIMATIEBEWIJS";
dbField.Description = fieldName;
dbField.HeadingText = fieldName;
dbField.Name = fieldName;
dbField.Type = CrFieldValueTypeEnum.crFieldValueTypeInt64sField;
fields.Add(dbField);
// More code for more tables to add.
table.DataFields = fields;
//CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo info =
// new CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo();
//info.Attributes.Add("Databse DLL", "xxx.dll");
//table.ConnectionInfo = info;
// Here an error occurs.
databaseController.AddTable(table, null);
ReportDoc.SetDataSource( [MyFilledDataSet] );
//object path = @"d:\logfiles\";
//ClientDoc.SaveAs("test.rpt", ref path, 0);
The object ClientDoc referes to a ISCDReportClientDocument in a base class:
internal abstract class Worker
private ReportDocument _ReportDoc;
private ISCDReportClientDocument _ClientDoc;
private string _ReportFileName;
public Worker(string reportFileName)
_ReportFileName = reportFileName;
_ReportDoc = new ReportDocument();
// Load the report from file path passed by the designer.
_ReportDoc.Load(reportFileName);
// Create a RAS Document through In-Proc RAS through the RPTDoc.
_ClientDoc = _ReportDoc.ReportClientDocument;
public string ReportFileName
get
return _ReportFileName;
public ReportDocument ReportDoc
get
return _ReportDoc;
public ISCDReportClientDocument ClientDoc
get
return _ClientDoc;
But I get an "Unspecified error" on the line databaseController.AddTable(table, null);
What am i doing wrong? Or is there another way to create a new report based on a DataSet in C# code?Hi,
Have a look at the snippet code below written for version 9 that you might accommodate to CR 2008, it demonstrates how to create a report based on a DataSet programmatically.
//=========================================================================
+ * the following two string values can be modified to reflect your system+
+ ************************************************************************************************/+
+ string mdb_path = "C:
program files
crystal decisions
crystal reports 9
samples
en
databases
xtreme.mdb"; // path to xtreme.mdb file+
+ string xsd_path = "C:
Crystal
rasnet
ras9_csharp_win_datasetreport
customer.xsd"; // path to customer schema file+
+ // Dataset+
+ OleDbConnection m_connection; // ado.net connection+
+ OleDbDataAdapter m_adapter; // ado.net adapter+
+ System.Data.DataSet m_dataset; // ado.net dataset+
+ // CR variables+
+ ReportClientDocument m_crReportDocument; // report client document+
+ Field m_crFieldCustomer;+
+ Field m_crFieldCountry;+
+ void CreateData()+
+ {+
+ // Create OLEDB connection+
+ m_connection = new OleDbConnection();+
+ m_connection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + mdb_path;+
+ // Create Data Adapter+
+ m_adapter = new OleDbDataAdapter("select * from Customer where Country='Canada'", m_connection);+
+ // create dataset and fill+
+ m_dataset = new System.Data.DataSet();+
+ m_adapter.Fill(m_dataset, "Customer");+
+ // create a schema file+
+ m_dataset.WriteXmlSchema(xsd_path);+
+ }+
+ // Adds a DataSource using dataset. Since this does not require intermediate schema file, this method+
+ // will work in a distributed environment where you have IIS box on server A and RAS Server on server B.+
+ void AddDataSourceUsingDataSet(+
+ ReportClientDocument rcDoc, // report client document+
+ System.Data.DataSet data) // dataset+
+ {+
+ // add a datasource+
+ DataSetConverter.AddDataSource(rcDoc, data);+
+ }+
+ // Adds a DataSource using a physical schema file. This method require you to have schema file in RAS Server+
+ // box (NOT ON SDK BOX). In distributed environment where you have IIS on server A and RAS on server B,+
+ // and you execute CreateData above, schema file is created in IIS box, and this method will fail, because+
+ // RAS server cannot see that schema file on its local machine. In such environment, you must use method+
+ // above.+
+ void AddDataSourceUsingSchemaFile(+
+ ReportClientDocument rcDoc, // report client document+
+ string schema_file_name, // xml schema file location+
+ string table_name, // table to be added+
+ System.Data.DataSet data) // dataset+
+ {+
+ PropertyBag crLogonInfo; // logon info+
+ PropertyBag crAttributes; // logon attributes+
+ ConnectionInfo crConnectionInfo; // connection info+
+ CrystalDecisions.ReportAppServer.DataDefModel.Table crTable;+
+ // database table+
+ // create logon property+
+ crLogonInfo = new PropertyBag();+
+ crLogonInfo["XML File Path"] = schema_file_name;+
+ // create logon attributes+
+ crAttributes = new PropertyBag();+
+ crAttributes["Database DLL"] = "crdb_adoplus.dll";+
+ crAttributes["QE_DatabaseType"] = "ADO.NET (XML)";+
+ crAttributes["QE_ServerDescription"] = "NewDataSet";+
+ crAttributes["QE_SQLDB"] = true;+
+ crAttributes["QE_LogonProperties"] = crLogonInfo;+
+ // create connection info+
+ crConnectionInfo = new ConnectionInfo();+
+ crConnectionInfo.Kind = CrConnectionInfoKindEnum.crConnectionInfoKindCRQE;+
+ crConnectionInfo.Attributes = crAttributes;+
+ // create a table+
+ crTable = new CrystalDecisions.ReportAppServer.DataDefModel.Table();+
+ crTable.ConnectionInfo = crConnectionInfo;+
+ crTable.Name = table_name;+
+ crTable.Alias = table_name;+
+ // add a table+
+ rcDoc.DatabaseController.AddTable(crTable, null);+
+ // pass dataset+
+ rcDoc.DatabaseController.SetDataSource(DataSetConverter.Convert(data), table_name, table_name);+
+ }+
+ void CreateReport()+
+ {+
+ int iField;+
+ // create ado.net dataset+
+ CreateData();+
+ // create report client document+
+ m_crReportDocument = new ReportClientDocument();+
+ m_crReportDocument.ReportAppServer = "127.0.0.1";+
+ // new report document+
+ m_crReportDocument.New();+
+ // add a datasource using a schema file+
+ // note that if you have distributed environment, you should use AddDataSourceUsingDataSet method instead.+
+ // for more information, refer to comments on these methods.+
+ AddDataSourceUsingSchemaFile(m_crReportDocument, xsd_path, "Customer", m_dataset);+
+ +
+ // get Customer Name and Country fields+
+ iField = m_crReportDocument.Database.Tables[0].DataFields.Find("Customer Name", CrFieldDisplayNameTypeEnum.crFieldDisplayNameName, CeLocale.ceLocaleUserDefault);+
+ m_crFieldCustomer = (Field)m_crReportDocument.Database.Tables[0].DataFields[iField];+
+ iField = m_crReportDocument.Database.Tables[0].DataFields.Find("Country", CrFieldDisplayNameTypeEnum.crFieldDisplayNameName, CeLocale.ceLocaleUserDefault);+
+ m_crFieldCountry = (Field)m_crReportDocument.Database.Tables[0].DataFields[iField];+
+ // add Customer Name and Country fields+
+ m_crReportDocument.DataDefController.ResultFieldController.Add(-1, m_crFieldCustomer);+
+ m_crReportDocument.DataDefController.ResultFieldController.Add(-1, m_crFieldCountry);+
+ // view report+
+ crystalReportViewer1.ReportSource = m_crReportDocument;+
+ }+
+ public Form1()+
+ {+
+ //+
+ // Required for Windows Form Designer support+
+ //+
+ InitializeComponent();+
+ // Create Report+
+ CreateReport();+
+ //+
+ // TODO: Add any constructor code after InitializeComponent call+
+ //+
+ }+//=========================================================================
Maybe you are looking for
-
Why can't I view embedded flash videos on my MacBook Pro?
I can view videos on Youtube and embedded videos on some sites, but when I try to view embedded Flash videos on sites like CNN.com and NBA.com, I just get a black rectangle and nothing loads. I've tried this on all browsers. BTW, I also cannot open
-
Snow Leopard and Appleworks not working well together ...
Still a dedicated fan of Appleworks mostly because I use the vector drawing program for my design business. But, even though it works in OSX.6, it is much changed. The drag-drop images from web sites print out in dot-matrix quality. Every clicked on
-
How to display all the rows in a JTable ???
Hi, i want to display blank lines in a JTable if there is not enough rows to fill in it. For the moment, there is nothing in the JTable if i have nothing in my tables. Where am i wrong ?? Thanks !!
-
Battery Life - How to extend it?
Hello!!! Basically I've got a question that should be silly: I've bought my MBP 2.16 and I gonna use it mainly in my office and just take it occasionaly. How should I use the battery? Should I leave it in the MBP all the time or only put it when I go
-
Extension can not be installed requires Illustrator version in range of 15 and 15.9
This extension can not be installed, it requires Illustrator version in range of inclusively between 15.0 and 15.9. Some of our customers are experiencing this error message while attemtping to install Illustrator CC using Extension Manager CC. This