Get a report joining data from Get-MailBox and Get-MailBoxStatistics

Hi
I have 2 cmdlets, and every has different information of the same users, the point is that I have to get the information of every cmdlet  and in excel I have to join the information
Is there a way to get both information joined in one shot?
This is one cmdlet:
Get-Mailbox -Server MB05 | Select-Object DisplayName,SamAccountName,UserPrincipalName,UseDatabaseRetentionDefaults,OrganizationalUnit,PrimarySmtpAddress,WhenCreated,WhenChanged,HiddenFromAddressListsEnabled,@{N="AddressListMembership";E={
$_.AddressListMembership -JOIN ';'}},UseDatabaseQuotaDefaults,ForwardingAddress,DeliverToMailboxAndForward,RecipientLimits,ManagedFolderMailboxPolicy,@{N="GrantSendOnBehalfTo";E={ $_.GrantSendOnBehalfTo -JOIN ';'}},MaxSendSize,MaxReceiveSize,Database
| Export-CSV -Path d:\ms\mb05.txt -Delimiter "`t"  -Encoding Unicode -NoTypeInformation
This is the other cmdlet:
Get-MailboxStatistics Server MB05| Select-Object DisplayName,Database,StorageLimitStatus,@{label="Total Size (MB)";expression={$_.TotalItemSize.Value.ToMB()}},@{label="Total Delete (MB)";expression={$_.TotalDeletedItemSize.Value.ToMB()}},
ItemCount,DeletedItemCount,LastLogoffTime,@{label="ProhibitSendQ (MB)";expression={$PSQ}}| Export-CSV -Path d:\ms\ms05a.txt -Delimiter "`t" -Encoding Unicode -NoTypeInformation
Thank you in advanced.
Doc MX

I think something like this would work:
$stuff = @()
Get-Mailbox -ResultSize unlimited -Database MB05| foreach{
$x = "" | select `
DisplayName, `
SamAccountName, `
UserPrincipalName, `
UseDatabaseRetentionDefaults, `
OrganizationalUnit, `
PrimarySmtpAddress, `
WhenCreated, `
WhenChanged, `
HiddenFromAddressListsEnabled, `
AddressListMembership, `
UseDatabaseQuotaDefaults,
ForwardingAddress, `
DeliverToMailboxAndForward, `
RecipientLimits, `
ManagedFolderMailboxPolicy, `
GrantSendOnBehalfTo, `
MaxSendSize, `
MaxReceiveSize, `
Database, `
StorageLimitStatus, `
'Total Size (MB)', `
'Total Delete (MB)', `
ItemCount, `
DeletedItemCount, `
LastLogoffTime, `
'ProhibitSendQ (MB)'
$m = Get-Mailbox $_
$x.DisplayName = $m.Displayname,
$x.SamAccountName = $m.SamAccountName,
etc.,
etc.,
etc.
$m = Get-MailboxStatistics $_
$x.StorageLimitStatus = $m.StorageLimitStatus,
$x.'Total Size (MB)' = $m.TotalItemSize.Value.ToMB(),
etc.,
etc.,
etc.
$stuff += $x
$stuff | export-csv -Path d:\ms\mb05.txt -Delimiter "`t" -Encoding Unicode -NoTypeInformation
--- Rich Matheisen MCSE&I, Exchange MVP

Similar Messages

  • How to join data from SAP BW and Oracle database from Webi?

    Hi,
    Need to  create a Web Intelligence Report connecting to multiple data sources.        
    Ø SAP-BW contains the data (All units).                                                                               
    Ø Oracle db contains the access security data (respective units                                                                    
    for the user).               
    Since Universe can only connect to a single data-source we have to create two universes connecting to SAP-BW and Oracle db respectively and then create a webi report to point the two universes to retrieve the equi-join data on the report.
    May I know which layer I can join the data? What kind of data I can join?
    Can I merge dimensions from both the data sources? What about measures?
    How I can create SQL query in Webi in order to simulate the join to the two data source?
    Appreciate any info related.
    thanks and regards
    nora

    Hi Nora,
    You can use Data Federator technology to federate multi-sources such as SAP BW and Oracle.
    Las you just have to create a universe on the Data Federator data source and the universe isee the data source as a single source whereas it is not.
    Then any clainet that consume uninverses can take advantage of this solution.
    Regards;
    Didier

  • Function module to get the dates from the year and the period

    Is there a function Module to get the dates from the year and the period

    Check with :
    To get last day of period use .
    LAST_DAY_IN_PERIOD_GET.
    To get last of month Use :
    RE_LAST_DAY_OF_MONTH
    HRVE_LAST_DAY_OF_MONTH
    LAST_DAY_OF_MONTHS
    ISB_PREVIOUS_PERIOD_DATE_GET
    Thanks
    Seshu

  • Search result to get data from bing search and display it in sharepoint page.

    I have configured result source which gets data from bing site,i have given following url as source url
    http://www.bing.com/search?q={?searchterms}&format=rss&Market=en-Us
    but it returns only 8 results from RSS. i want to get all results of search and display it in my SharePoint search results page. 
    any pointers will be helpful. 

    Hi,
    According to your post, my understanding is that you wanted to search result to get data from bing search and displayed it in sharepoint page.
    To display more items, you can modify the item number when you add
    New Query Rule.
    To get all results, I recommend to use the “Show More”
    link in the result page.
    You can enter the URL when you add New Query Rule:
    "More" link goes to the following URL: http://www.bing.com/search?q={searchterms}
    Here is a great blog for your reference:
    http://sharepoint-community.net/profiles/blogs/integrate-bing-with-sharepoint-online-2013-search
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Create a visual web part which get data from excel sheet and import it into sql server database in sharepoint 2010 (development)

    Hi,
    I want to create a visual webpart which will read data from excel sheet and import it in to sql server database.(using sharepoint development)
    I want to do it using visual webpart.
    Please help to solve the issue.
    Thanks in advance!
    Regards
    Rajni

    Hi  Rajni,
    Microsoft.Office.Interop.Excel assembly provides class to read excel file data, in your web part solution, reference the assembly, and following blog contains samples about how to read the excel file data,
    and import it to SQL  database.
    1.Create a Visual Web Part Project:Create
    Visual Web Parts in SharePoint 2010
    2.Read the excel workbook by using SPFile class:
    http://alancejacob.blogspot.in/2012/06/read-data-from-excel-file-and-insert-in.html
    http://stackoverflow.com/questions/14496608/read-excel-file-stored-in-sharepoint-document-library
    3.Export the excel workbook to SQL Server:
    http://www.c-sharpcorner.com/UploadFile/99bb20/import-excel-data-to-sql-server-in-Asp-Net/
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • Report to display (actuals data from one cube and plan from another)

    Hi Gurus,
             I have a requirement in reporting to display actual data from one cube and plan data from a different one.
            The example below might give a clear picture of the requirement.
    rows has key figures and columns = months
    Jan |  Feb |  Mar |  Apr |  May |  Jun  ...   ....
    GrossSales
    Net Sales   
    Now if I run the report for Current month (Apr), then for the months of (Jan, Feb and Mar) i need to get the data from CUBE1   and for the remaining months (Apr thru Dec) from CUBE2.
    Similarly when i run the report next month(may), 
    then (data for Jan, Feb, Mar, Apr  from CUBE1)
    and ( May thru Dec from CUBE2)
    Any suggestions.
    Thanks in Advance
    Kumar

    Hi Henry,
         We alreadey have a multi provider which includes
    FinDat Cube(CUBE1) for actuals and Comm.Goals cube (CUBE2) for plan.
    So you suggest that we have two versions of key figure for actual and plan.
    ie. each KF will have two versions.
    actuals = (version 10, FiscPer<curr.mnth, key figure, acutals cube)
    Plan = (version 20, FiscPer>=curr.mnth, key figure, comm.goals cube)
    eg:
    Jan | Feb | Mar | Apr | May | Jun ...
    GrossSales(Act)
    GrossSlaes(Plan)
    Net Sales(Acutal)
    Net Sales(Plan)
    Correct me if I am wrong.
    the report has a lot of key figures, having two versions for each kf will be confusing.
    the user would like to see
    Jan.....| ...Feb  |..Mar |..Apr.....|  May  | 
    GrossSales   Act Value|Act.V |Act.V| PlanVal|PlanVal|
    Net Sales
    where Act.Value is from CUBE1
             Plan Value is from CUBE2
    Thanks
    Kumar

  • How create report with data from table and some columns results function ?

    Hi,
    How can i create on apex report region with some columns (of the report) as returned from a table and the other columns as results of plsql functions ?
    for example , I want to create a report like that:
    device last_date error_msg stop/start
    kodak1 06/04/08 null >>
    kodak2 08/03/08 good msg --^--
    kodak3 08/04/08 err msg >>
    3 rows returned
    where the 3 first columns are data returned from the table and the forth column is the result of plsql function (returned for example false) and on that i want to display a button of start ( >> in this example ) or stop ( --^-- in this example)

    Thomas,
    There is no problem here -- this is fully suported scenario.
    1. Bind Table dataSource to Customers node.
    2. Bind individual cell editors to any attribute of customer or any nested node like Address, say create column with InputField as editor, then for "value" property select Customer.Address.Street.
    Your nested nodes (like Address) must be non-singleton, set singleton=false on context designer tab.
    Valery Silaev
    EPAM Systems
    http://www.NetWeaverTeam.com

  • Join data from 2 data sources

    Hi,
      I am trying to join data from 2 web services and present as a single table. I tried "union", "intersection"  and a few other operators but they didn't give any output. Appreciate any help in this regard.
    Thanks
    Kiran

    What version of Visual Composer are you using?

  • Error while loading Reported Financial Data from Data Stream

    Hi Guys,
    I'm facing the following error while loading Reported Financial Data from Data Stream:
    Message no. UCD1003: Item "Blank" is not defined in Cons Chart of Accts 01
    The message appears in Target Data.  Item is not filled in almost 50% of the target data records and the error message appears.
    Upon deeper analysis I found that Some Items are defined with Dr./Cr. sign of + and with no breakdown.  When these items appear as negative (Cr.) in the Source Data, they are not properly loaded to the target data.  Item is not filled up, hence causing the error.
    For Example: Item "114190 - Prepayments" is defined with + Debit/Credit Sign.  When it is posted as negative / Credit in the source data, it is not properly written to the target.
    Should I need to define any breakdown category for these items?  I think there's something wrong with the Item definitions OR I'm missing something....
    I would highly appreciate your quick assistance in this.
    Kind regards,
    Amir

    Found the answer with OSS Note: 642591..... 
    Thanks

  • How to retrieve time data from infotypes 2001 and 2002 when we use PNPCE

    Hello Everyone,
       I am new in using PNPCE ldb.In the requirement i have to retrieve time data from infotypes 2001 and 2002 between the begda and endda.I tried using the macro RP-READ-ALL-TIME-ITY to retrieve data.But its not supporting.Can some body help me in doing this.
    THanks in Advance..
    Regards,
    Chinni.

    Hi
       Try the following code:
    REPORT  ZHRTM41.
    nodes peras.
    Tables: PERNR.
    Infotypes: 2001.
    start-of-selection.
    get peras.
    rp_read_all_time_ity pn-begda pn-endda.
    end-of-selection.
    loop at p2001.
    write:/ p2001-abwtg,p2001-stdaz.
    endloop.
        It worked for me when using PNPCE. let me know if you have any problem
    Thanks,
    V.Nagaraju

  • How to read the data from Excel file and Store in XML file using java

    Hi All,
    I got a problem with Excel file.
    My problem is how to read the data from Excel file and Store in XML file using java excel api.
    For getting the data from Excel file what are all the steps i need to follow to get the correct result.
    Any body can send me the code (with java code ,Excel sheet) to this mail id : [email protected]
    Thanks & Regards,
    Sreenu,
    [email protected],
    india,

    If you want someone to do your work, please have the courtesy to provide payment.
    http://www.rentacoder.com

  • Help combining output data from an HP4140B and a LakeShore 330

    Hi!
    First of all, I would like to apologize if this question has already been answered in the forums, but I haven't been able to find anything for this particular situation... I am using LabView v.8.6 so as to conduct TSC (thermally stimulated current) measurements, by controlling a Lake Shore Cryotronics 330 (Lake Shore Model 330 Autotuning Temperature Controller) and a HP4140B pA meter. I am taking as a starting point the VIs available in the driver libraries (http://sine.ni.com/apps/utf8/niid_web_display.download_page?p_id_guid=014FB74E7B0C1ED3E0440003BA7CCD... and http://sine.ni.com/apps/utf8/niid_web_display.download_page?p_id_guid=E3B19B3E92C3659CE034080020E748..., respectively), and I would like to merge both programs ("Lake Shore Cryotronics Controller Output.vi" and "HP4140B Example (current vs. voltage).vi") into a single program that can simultaneously record both the current values (at a fixed voltage) from the HP4140B and the temperature as it is changed in the 76K to 300K range (with the Lakeshore 330).
    The problem lies in the fact that I don't know how to make compatible the numeric output "Sample sensor data" of the Lakeshore with the numeric array (which does not have a defined size) named "current/cap" of the HP4140B in aforementioned programs. What I am trying to do is to: (1) save the data to a file (I have attempted using "Write to measurement file" Express block, which I am not sure of whether it's the best option or not); and (2) plot current vs. temperature (not current vs. time and temperature vs. time separately).
    Any help with these issues would be most appreciated, since I'm stuck on my research because I can't record any data! This really goes right over my head...
    PS: I enclose the file that I have been working on, but perhaps it's better to work from scratch (I'm still a newbie and I may have made errors!)
    Solved!
    Go to Solution.
    Attachments:
    Current_vs_Temp.vi ‏69 KB

    Kyle,
    Thank you for your response and sorry for having taken a while to reply, but the equipment is shared with other groups and I haven't had access to it in a while.
    I have managed to get the program running using LabVIEW 7.1 (I don't know why, but the HP4140B drivers don't seem to be compatible with LabVIEW 8.6) and using the "HP4140B Read Single Meas.vi" example (and not "HP4140B Read Wave Meas.vi", as I had tried before) so as to get a double instead of an array, avoiding synchronization problems when merging data from the HP4140B and the LakeSHore 330. Then I have used a do-while loop to get "continuous sampling" of the waveform. Nonetheless, because of having chosen this approach, now I can only use a fixed voltage, which would be of for a TSC measurement, except for the fact that I need to increase the voltage in small steps so as to avoid damaging the sample. I am using another do-while loop so as to keep increasing the voltage gradually (and also be able to update the LakeShore 330 parameters), and once the desired voltage is achieved, I press a "stop" button, allowing the program to flow into the next stage and take the measurements... I am aware that it's not an elegant solution, so if you can come up any ideas for an improved version, it would be most appreciated!
    Regards,
    Pablo
    Attachments:
    IvsTemp_LabVIEW7_final.vi ‏267 KB

  • Retrieving data from an ArrayList and presenting them in a JSP

    Dear Fellow Java Developers:
    I am developing a catalogue site that would give the user the option of viewing items on a JSP page. The thing is, a user may request to view a certain item of which there are several varieties, for example "shirts". There may be 20 different varieties, and the catalogue page would present the 20 different shirts on the page. However, I want to give the user the option of either viewing all the shirts on a single page, or view a certain number at a time, and view the other shirts on a second or third JSP page.
    See the following link as an example:
    http://www.eddiebauer.com/eb/cat_default.asp?nv=2|21472|9&tid=&c=&sc=&cm_cg=&lp=n2f
    I am able to retrieve the data from the database, and present all of them on a JSP, however I am not sure how to implement the functionality so that they can be viewed a certain number at a time. So if I want to present say 12 items on a page and the database resultset brings back 30 items, I should be able to present the first 12 items on page1, the next 12 items on page2, and the remaining 6 items on page3. How would I do this? Below is my scriplet code that I use to retrieve information from the ArrayList that I retrieve from my database and present them in their entirety on a single JSP page:
    <table>
    <tr>
    <%String product=request.getParameter("item");
    ArrayList list=aBean.getCatalogueData(product);
    int j=0, n=2;
    for(Iterator i=list.iterator(); i.hasNext(); j++){
    if(j>n){
    out.print("</tr><tr>");
    j=0;
    Integer id=(Integer)i.next();
    String name=(String)i.next();
    String productURL=(String)i.next();
    out.print("a bunch of html with the above variables embedded inside")
    %>
    </tr>
    </table>
    where aBean is an instace of a JavaBean that retrieves the data from the Database.
    I have two ideas, because each iteration of the for loop represents one row from the database, I was thinking of introducing another int variable k that would be used to count all the iterations in the for loop, thus knowing the exact number. Once we had that value, we would then be able to determine if it was greater than or less than or equal to the maximum number of items we wanted to present on the JSP page( in this case 12). Once we had that value would then pass that value along to the next page and the for loop in each subsequent JSP page would continue from where the previous JSP page left off. The other option, would be to create a new ArrayList for each JSP page, where each JSP page would have an ArrayList that held all the items that it would present and that was it. Which approach is best? And more importantly, how would I implement it?
    Just wondering.
    Thanks in advance to all that reply.
    Sincerely;
    Fayyaz

    -You said to pass two parameters in the request,
    "start", and "count". The initial values for "start"
    would be zero, and the inital value for "count" would
    be the number of rows in the resultSet from the
    database, correct?Correct.
    -I am a little fuzzy about the following block of code
    you gave:
    //Set start and count for next page
    start += count; // If less than count left in array, send the number left to next next page
    count = ((start*3)+(count*3) < list.size()) ? (count) : ((list.size() - (start*3))/3)
    Could you explain the above block of code a little
    further please?Okay, first, I was using the ternary operators (boolean) ? val_if_true : val_if_false;
    This works like an if() else ; statement, where the expression before the ? represents the condition of the if statement, the result of the expression directly after the ? is returned if the condition is true, and the expression after the : is returned if the condition is false. These two statments below, one using the ternary ? : operators, and the other an if/else, do the same thing:
    count = ((start*3)+(count*3) < list.size()) ? (count) : ((list.size() - (start*3))/3);
    if ((start*3)+(count*3) < list.size()) count = count;
    else count = ((list.size() - (start*3))/3);Now, why all the multiplying by 3s? Because you store three values in your list for each product, 1) the product ID, 2) the product Name, and 3) the product URL. So to look at the third item, we need to be looking at the 9th,10th, and 11th values in the list.
    So I want to avoid an ArrayIndexOutOfBounds error from occuring if I try to access the List by an index greater than the size of the list. Since I am working with product numbers, and not the number of items stored in the list, I need to multiply by three, both the start and count, to make sure their sum does not exceed the value stored in the list. I test this with ((start*3)+(count*3) < list.size()) ?. It could have been done like: ((start + count) * 3 < list.size()) ?.
    So if this is true, the next page can begin looking through the list at the correct start position and find the number of items we want to display without overstepping the end of the list. So we can leave count the way it is.
    If this is false, then we want to change count so we will only traverse the number of products that are left in the list. To do this, we subtract where the next page is going to start looking in the list (start*3) from the total size of the list, and devide that by 3, to get the number of products left (which will be less then count. To do this, I used: ((list.size() - (start*3))/3), but I could have used: ((list.size()/3) - start).
    Does this explain it enough? I don't think I used the best math in the original post, and the line might be better written as:
    count = ((size + count)*3 < list.size()) ? (count) : ((list.size()/3) - start);All this math would be unnecessary if you made a ProductBean that stored the three values in it.
    >
    - You have the following code snippet:
    //Get the string to display this same JSP, but with new start and count
    String nextDisplayURL = encodeRedirectURL("thispage.jsp?start=" + start + "&count=" + count + "&item=" + product);
    %>
    <a href="<%=nextDisplayURL%>">Next Page</a>
    How would you do a previous page URL? Also, I need to
    place the "previous", "next" and the different page
    number values at the top of the JSP page, as in the
    following url:
    http://www.eddiebauer.com/eb/cat_default.asp?nv=2|21472
    9&tid=&c=&sc=&cm_cg=&lp=n2f
    How do I do this? I figure this might be a problem
    since I am processing the code in the middle of the
    page, and then I need to have these variables right at
    the top. Any suggestions?One way is to make new variable names, 'nextStart', 'previousStart', 'nextCount', 'previousCount'.
    Calculate these at the top, based on start and count, but leave the ints you use for start and count unchanged. You may want to store the count in the session rather than pass it along, if this is the case. Then you just worry about the start, or page number (start would be (page number - 1) * count. This would be better because the count for the last page will be less than the count on other pages, If we put the count in session we will remember that for previous pages...
    I think with the details I provided in this and previous post, you should be able to write the necessary code.
    >
    Thanks once again for all of your help, I really do
    appreciate the time and effort.
    Take care.
    Sincerely;
    Fayyaz

  • Extract data from database tables and download in pdf and csv

    extract data from database tables and download in pdf and csv
    hi how can i re-write my old form procedure in adf java. the procedure used to extract data from diffirent table and dowload the data in pdf and csv.am not downloading image, i what to extract data from diffirent tables in my database and download that data in pdf and csv. i would like to write this in java adf.i just what direction am not asking anyone to do my work this is my learning curve
    the form code is
    function merge_header3 return varchar2 is
    begin
         return '~FACILITY DESCRIPTION~ACCOUNT NO~BRANCH CODE~BANK REF NO.~P/P/ AMOUNT~Postal Address 1~Postal Address 2~Box Postal Code~Dep. Date~Month~BANK NAME~BRANCH NAME~ACCOUNT TYPE~DESCRIPTION~OBJECTIVE DESCRIPTION';
    end;
    procedure download_file (i_pbat integer) is
      dir varchar2(80);
      file_name1 varchar2(80);
      file_name2 varchar2(80);
      appl_code varchar2(80);
      fil1 client_text_io.file_type;
      fil2 client_text_io.file_type;
      dat varchar2(1000);
      DATA VARCHAR2(1000);
      bvspro varchar2(100);
      ssch   varchar2(100);
      bvspro_total number(20,2);
      ssch_total   number(20,2);
      grand_total  number(20,2);
      cnt    integer;
      cursor pbat is
           select *
           from sms_payment_batches
           where id = i_pbat
      cursor pay  (pb_id integer) is
           select *
           from sms_payment_vw
           where pbat_id = pb_id
           order by subsidy ASC,programme,beneficiary_name
      cursor cgref (low varchar2) is
           select *
           from cg_ref_codes
           where rv_domain ='SMS'
           and rv_low_value = low
      success boolean;     
      begin  
           set_application_property(cursor_style,'busy');
           appl_code := sms_global.ref_code('SMS','APP_CODE','SMS',0);
        dir       := sms_global.ref_code('SMS','PAY_DIR','c:\sms\batch_payments',0);
             success := webutil_file.create_directory(dir);
         if webutil_file.file_is_directory(dir) then
             null;
    --         message ('directory exists');
        else
    --                  message ('create directory ');
             success := webutil_file.create_directory(dir);
    --         if success then        message ('directory exists');    end if;
        end if;     
        for c_pbat in pbat loop
             file_name1 := dir ||'\' || appl_code||c_pbat.batch_number||'-'||to_char(c_pbat.batch_dt,'yyyymmdd')||'pay.txt';
             file_name2 := dir ||'\' || appl_code||c_pbat.batch_number||'-'||to_char(c_pbat.batch_dt,'yyyymmdd')||'merge.txt';
    --message('create files ');
    --         fil1  := client_text_io.fopen (file_name1,'W');
    --         fil2  := client_text_io.fopen (file_name2,'W');
        fil1  := client_text_io.fopen (file_name1,'W','');
        fil2  := client_text_io.fopen (file_name2,'W','');
                   dat :=                       'FROM ACCOUNT NUMBER'
                                                                ||'~'||'FROM ACCOUNT DESCRIPTION'
                                                                ||'~'||'MY STATEMENT DESCRIPTION'
                                                                ||'~'||'BENEFICIARY ACCOUNT NUMBER'
                                                                ||'~'||'BENEFICIARY SUB ACCOUNT NUMBER'        
                                                                ||'~'||'BENEFICIARY BRANCH CODE'
                                                                ||'~'||'BENEFICIARY NAME'
                                                                ||'~'||'BENEFICIARY STATEMENT DESCRIPTION'
                                                                ||'~'||'AMOUNT';
             --     client_text_io.put_line(fil1,dat);
             bvspro:= null;
             ssch  := null;
             cnt := 0;     
             dat := '~'||lpad('~',16,'~');
             for c_pay in pay(c_pbat.id) loop
    --message('cpay loop ' || cnt);              
               if bvspro is null then
                     dat := lpad('~',16,'~');
                     dat := utility.put_field(1,c_pay.programme,dat,'~');     
               client_text_io.put_line(fil2,dat);
               dat := utility.put_field(1,c_pay.subsidy,dat,'~');
               client_text_io.put_line(fil2,dat);
               dat := merge_header3;
                     client_text_io.put_line(fil2,dat);
                     bvspro := c_pay.programme;
                     ssch := c_pay.subsidy;
                     grand_total := 0;
                     bvspro_total := 0;
                     ssch_total := 0;
               end if;
               if bvspro <> c_pay.programme then
                     dat := lpad('~',16,'~');
                     dat := utility.put_field(5,ssch_total,dat,'~');
                     dat := lpad('~',16,'~');
                     dat := utility.put_field(5,bvspro_total,dat,'~');
               dat := utility.put_field(1,'Total:' || bvspro,dat,'~');
                     client_text_io.put_line(fil2,dat);
                     dat := lpad('~',16,'~');
               client_text_io.put_line(fil2,dat);
                     dat := utility.put_field(1,c_pay.programme,dat,'~');     
               client_text_io.put_line(fil2,dat);
                     bvspro := c_pay.programme;
               dat := utility.put_field(1,c_pay.subsidy,dat,'~');
               client_text_io.put_line(fil2,dat);
               dat := merge_header3;
                     client_text_io.put_line(fil2,dat);
                     bvspro := c_pay.programme;
                     ssch := c_pay.subsidy;
                     bvspro_total := 0;
                     ssch_total := 0;
                     cnt :=0;
             end if;                           
               if ssch <> c_pay.subsidy then
                     dat := lpad('~',16,'~');
                     dat := utility.put_field(5,ssch_total,dat,'~');
                     dat := lpad('~',16,'~');
               client_text_io.put_line(fil2,dat);
               dat := utility.put_field(1,c_pay.subsidy,dat,'~');
               client_text_io.put_line(fil2,dat);
               dat := merge_header3;
                     client_text_io.put_line(fil2,dat);
                     ssch := c_pay.subsidy;
                     ssch_total := 0;
                     cnt :=0;
             end if;                           
            bvspro_total := bvspro_total + c_pay.amount;
            ssch_total   := ssch_total   + c_pay.amount;              
                  grand_total  := grand_total  + c_pay.amount;              
            cnt := cnt +1;
    --message('bfore write file 2 ' );              
            client_text_io.put_line(fil2
                                   ,cnt
                            ||'~'|| c_pay.beneficiary_name
                                                                ||'~'||c_pay.BENEFICIARY_ACCOUNT_NUMBER ||''            
                                                                ||'~'||c_pay.BRANCH_CODE             ||''           
                                                                ||'~'|| c_pay.BENEFICIARY_STATEMENT_DESC            
                                                                ||'~'|| c_pay.AMOUNT                                
                            ||'~'|| c_pay.address_line1
                            ||'~'|| c_pay.address_line2
                                                    ||'~'|| c_pay.postal_code
                                                    ||'~'|| TO_CHAR(c_pay.deposit_date,'DD-Mon-YYYY')
                                                    ||'~'|| c_pay.month
                                                    ||'~'|| c_pay.bank
                                                    ||'~'|| c_pay.bank_branch
                                                    ||'~'|| c_pay.account_type
                                                    ||'~'|| c_pay.subsidy
                                                    ||'~'|| c_pay.programme)
                  DATA :=                                  c_pay.FROM_ACCOUNT_NUMBER                   
                                                                ||'~'||c_pay.FROM_ACCOUNT_DESCR                    
                                                                ||'~'||c_pay.MY_STATEMENT_DESCR                    
                                                                ||'~'||c_pay.BENEFICIARY_ACCOUNT_NUMBER
                                                                ||'~'
                                                                ||'~'||c_pay.BRANCH_CODE            
                                                                ||'~'||c_pay.BENEFICIARY_NAME                      
                                                                ||'~'||c_pay.BENEFICIARY_STATEMENT_DESC            
                                                                ||'~'||c_pay.AMOUNT;                                
            DATA := REPLACE(DATA, ',' , ' ' );
            DATA := REPLACE(DATA, '~' , ',' );
    --message (cnt ||' ' || data);       
    --message('bfore write file 1 ' );              
                  client_text_io.put_line(fil1, data);
             end loop;
    --message ('end of write');         
                 dat := lpad('~',16,'~');
                 dat := utility.put_field(6,ssch_total,dat,'~');
                 dat := lpad('~',16,'~');
           dat := utility.put_field(1,'Total:' || bvspro,dat,'~');
                 dat := utility.put_field(5,bvspro_total,dat,'~');
              client_text_io.put_line(fil2,dat);
              dat := lpad('~',16,'~');
           client_text_io.put_line(fil2,dat);
           dat := utility.put_field(1,'Grand Total:' ,dat,'~');
                 dat := utility.put_field(5,grand_total,dat,'~');
              client_text_io.put_line(fil2,dat);
             -- close file
    for i in 1..50 loop  
           if substr(i,-1) = 0 then
                 message ('flush ' || i);
           end if;                 
                  client_text_io.put_line(fil1, lpad(' ',2000));
                  client_text_io.put_line(fil2, lpad(' ',2000));
                  client_text_io.put_line(fil1, lpad(' ',2000));
                  client_text_io.put_line(fil2, lpad(' ',2000));
    end loop;
             client_text_io.fclose(fil1);
             client_text_io.fclose(fil2);
        end loop;
       set_application_property(cursor_style,'default');
        exception
             when others then
                  message(sqlcode ||' ' ||sqlerrm);
       end download_file;    i try this but this code onlydownload image not data from database tables
        public void downloadImage(FacesContext facesContext, OutputStream outputStream)
            BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
            // get an ADF attributevalue from the ADF page definitions
            AttributeBinding attr = (AttributeBinding) bindings.getControlBinding("DocumentImage");
            if (attr == null)
                return;
            // the value is a BlobDomain data type
            BlobDomain blob = (BlobDomain) attr.getInputValue();
            try
            {   // copy the data from the BlobDomain to the output stream
                IOUtils.copy(blob.getInputStream(), outputStream);
                // cloase the blob to release the recources
                blob.closeInputStream();
                // flush the output stream
                outputStream.flush();
            catch (IOException e)
                // handle errors
                e.printStackTrace();
                FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_ERROR, e.getMessage(), "");
                FacesContext.getCurrentInstance().addMessage(null, msg);
            }

    You should ask your forum in the ADF-forum.

  • In Gmail we have two mailboxes mine and my wife's. When I send from my mailbox and when i indicate my mailbox in the 'from' box, it always picks up and sends my wife's email address. Help

    in Gmail we have two mailboxes mine and my wife's. When I send from my mailbox and when i indicate my mailbox in the 'from' box, it always picks up and sends my wife's email address. Help

    I have this exact problem.  I have 3 email addresses on my mac and I can select one, and the email still be sent through another account and I won't know it until I get a reply for that email in one of the other accounts.
    MacBook Pro, Mac OS X 10.9

Maybe you are looking for

  • Apple Mobile Device Support version 4 doesn't install with iTunes 10.5

    I have not been able to upgrade to itunes 10.5.  I have uninstalled and reinstalled every apple program and when I reinstalled iTunes 10.5 I figured out that the only thing that's not reinstalling is the mobile device support which is required for IO

  • How do I create an AppleDouble "dot-underscore" file from the command line?

    We're going through a process of migrating NetWare shares to Windows shares (without File Services for Macintosh) where I work. One concern is that the NetWare shares are shared as AFP volumes to the Macs. All the finder info and metadata for the fil

  • Automatic failover

    Dear all, 10.2.0.3 on windows 2003. One of our clients wants to have a DR site of their primary rac database and insist to have automatic failover to DR site ?. Please suggest me what are all the options available to implement DR site with automatic

  • Satellite A100 - USB not working after XP installation

    Hi Guys I am reloading Satellite A100 PSAA9A OCV004 for a friend he has lost the disks so I have loaded a legal copy of XP home everything going well so far but I can't get the USB working any ideas? Tnx Mick.

  • N79 video capture color shift

    I have noticed that the video camera in my n79 is very sensitive to changes in light.  Often I get a major color shift during a video capture seemingly for no reason, especially when shooting outside.  Is this a defect or should I use a particular se