Skip to content

Instantly share code, notes, and snippets.

@ahnooie
Last active December 30, 2016 23:29
Show Gist options
  • Save ahnooie/eb2bddc57bac01bde525d902ae0bbcf8 to your computer and use it in GitHub Desktop.
Save ahnooie/eb2bddc57bac01bde525d902ae0bbcf8 to your computer and use it in GitHub Desktop.
DML SSRS Print Example
FORM SETUP /ROW=3 /COL=2 /HEIGHT=20 /WIDTH=70 /TITLE="Example SSRS Print"
BEGIN_BLOCK Documentation
! =====================================================
! Example SSRS Print
! =====================================================
END_BLOCK
BEGIN_BLOCK Modifications
!
END_BLOCK
BEGIN_BLOCK SETUP
START_TRANSACTION
#COMPANY_CODE = PARAMETER("USER_COMPANY_CODE")
#YES = PARAMETER("LANGUAGE_YES"
END_BLOCK
BEGIN_BLOCK RESTART
DISPLAY REFRESH
END_BLOCK
BEGIN_BLOCK GET_FIELD
INPUT_BLOCK /ROW=4 /COL=27 /LEN=12 &
/Prompt=("Numbers") &
/Target=#NUMBERS &
/Using=TABLE_NAME(FIELD),MULTIPLE,REQUIRED &
/Lov=TABLE_NAME(FIELD,OTHER_NUMBER,SOME_CODE) &
/Lov_Sorted_By=TABLE_NAME(FIELD) desc
END_BLOCK
BEGIN_BLOCK SETUP_PRINT_SSRS
#SSRS_NUMBERS = ""
Perform ExportRowsForPrint
Commit
Open_Url /url=("http://ssrsserver.example.com:8080/ReportServer_EXAMPLEFORMS/Pages/ReportViewer.aspx?%2fForms%2fSomeReport" & #SSRS_NUMBERS & "&rs:Command=Render&rs:Renderer=HTML5&rs:PARAMETERs=False&rs:HeaderArea=none") &
/desc="BOL Print Result"
END_BLOCK
BEGIN_BLOCK LoopBack
GOTO SETUP
END_BLOCK
BEGIN_BLOCK UNDO
ROLLBACK
COMMIT
GOTO RESTART
END_BLOCK
END_FORM
PROCEDURE_FORM ExportRowsForPrint &
/TABLE=TABLE_NAME &
/WITH=COMPANY_CODE = #COMPANY_CODE &
/WITH=FIELD AMONG #NUMBERS &
/SELECTION=("A AND B")
BEGIN_BLOCK PrintTransactions
! The SSRS Paramater should be as short as possible. E.g. "D" as in the example below.
#SSRS_NUMBERS = (#SSRS_NUMBERS & "&D=" & TABLE_NAME(FIELD))
END_BLOCK
END_FORM
The MIT License (MIT)
Copyright (c) 2016 Litehouse, Inc.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject
to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment