DataGrid: data driven datagrid column headers

I have a datagrid that I would like to populate the
datagridcolumn headers with specific data at runtime.
I'm going through the array of data objects and creating each
column but I still need to figure out how to set the header for
each one. I tried setting the itemRenderer for the column to a
simple lable component but then I don't know how to set the text of
this label to the correct datadriven objects say name field.
Any help would be greatly appreciated,
Ruben

I figured this out. Basically before you set the
headerRenderer you get your component and wrap it around a
ClassFactory object and then set the property you want to appear in
the header. You can do this in a loop and change the header as you
go. Here is some code that might go in a loop:
var lblFact:ClassFactory=new ClassFactory(Label);
lblFact.properties={text:"changing text data"};
dgColumn.headerRenderer=lblFact;
Maybe this will help someone later on.

Similar Messages

  • Column headers and data are mismatched in Data tab of views after move col.

    Hi,
    Currently, I am using Windows XP, SQL Developer Version 1.2.1 Build Main 32.13.
    Java platform 1.5.0_06
    Oracle IDE 1.2.1.3213
    I'm having trouble with display of data from views in the "Data" tab of SQL Developer. If I move a column left or right of its original place, the data no longer line up with the proper column heading. The data are in the correct order, but the column headers are out of whack. Also, in the Single Record View, the data and column headers are mismatched.
    Refreshing the view, closing the view, closing and reopening SQL Developer do not "reset" the view so that the data and proper column headers are lined up. Even dropping and recreating the view does not force SQL Developer to use the proper data-column header match.
    Just to be clear, the data within the view is fine. It is the display of the data-column headers in the "Data" tab of SQL Developer (and the single record view) that is wrong. The mismatch seems to occur after a column is moved in the view.
    Is this a bug? I like the ability to move columns around within the display of the view. However, much more important that the column headers and data line up correctly.
    Thanks,
    Morgan

    Thanks much. I found the correct file, deleted it, and the column headers and data match up again.
    I found the correct file by searching the directory for one of the column names that occurs in the view (though I had to find both instances of "COLUMN_NAME" and "COLUMN NAME" (without the underscore)). Not sure why there were files with both versions.
    Do you know if there is any way to prevent those XXXXXXXXXTableSettings.xml files from writing all together (oracle.javatools.controls.nicetable.NiceTablePersistentSettings)? I looked through the SQL Developer preferences but nothing jumped out as being the setting to switch off.
    Should I be doing anything in particular to bring more attention to this potential bug so it might get fixed in a future release?
    Thanks again,
    Morgan

  • Column Headers are Jumbled when exporting to 'Excel Data only'

    Hi,
    When I am exporting a report to 'Excel Data only' the column headers are jumbled in the output,where as the data field are exported in the same order as it is in the report .
    They are being exported as
    Header:F3   F2    F1
    Detail   :F1   F2    F3
    Instead of
    Header:F1   F2    F3
    Detail   :F1   F2    F3
    Is there a way I can over come this issue.

    Can you explain how exactly the report was designed? Is it happening for every report or only for this report?
    Regards,
    Raghavendra

  • Multiple column headers in a single DataGrid?

    Suppose i wanted to display information on, say, invoices.
    So, i want to display one part of my DataGrid with only invoices from the last 30 days, the next section for 30-60 days old, and the third section is 90 days+ old.
    I want it to look, basically, like this:
    30 Days or less
    Customer         Days Old         amount
    Mr. X cleaning           15                20.76
    7-11                             3                   7.11
    30-60 days old
    Customer         Days Old         amount
    Barney's                  75                 12.34
    Watto's part shop    80              1200.89
    90 days or older
    Customer         Days Old         amount
    Sprint                   144                  30.63
    Is it possible to do this in a single DataGrid? I want the mulitple column headers, but want to be able to get rid of them and combine all this data into a single DataGrid with all invoices, if needs be. In that case all but the top column header titles would disappear.
    Any info on this is appreciated.
    thanks!

    Hi,
    You can do grouping with advance datagrid.
    http://livedocs.adobe.com/flex/3/html/help.html?content=advdatagrid_02.html
    Rgds
    Johnny

  • How to insert data into datagrid dynamically and also programatically with data and column names being retrived from a xml file..

    iam not able to insert data into datagrid corresponding to the column names..as iam inserting both data and column names programatically..ie iam not able to co relate the data with the column names.plzzz help me asap

    A DataGrid is row-based rather than cell-based with each row
    corresponding to an item in an underlying collection (specified in the
    dataProvider property). In order to add data to a DataGrid you
    manipulate the underlying collection, rather than the grid directly.
    Based on the limited description of your problem I would imagine you
    would need to create dynamic objects with property names that correspond
    to the dataFields of your dynamically created datagrid columns.
    So if you had created columns with dataFields "alpha", "beta" and
    "gamma" on your datagrid, you could create an item in your grid by
    adding the following object to your dataProvider:
    var gridItem : Object = new Object();
    gridItem.alpha = "alphaValue";
    gridItem.beta = "betaValue";
    gridItem.gamma = "gammaValue";

  • Flex datagrid data column / webservice

    I use a web service to populate a datagrid and its columns
    (on of which is date). The web services sources the data from a sql
    server database and thru ASP.net to the Flex application. I've been
    seeing strange things. During testing, database records such as
    "8/27/2008 8:58:00 PM " correctly shows up as 8/27/2008 in the Flex
    application, but records after 9PM such as "8/27/2008 9:01:21 PM"
    shows up as 8/28/2008 (the next days) .. seems like after 9 throws
    off the data rendering.. please suggest.

    Adobe Newsbot hopes that the following resources helps you.
    NewsBot is experimental and any feedback (reply to this post) on
    its utility will be appreciated:
    Flex 3 - Handling service results:
    Flex interprets the XML data that a web service or HTTP
    service returns to ..... a DataGrid control with DataTable data
    returned from a .NET web service.
    Link:
    http://livedocs.adobe.com/flex/3/html/data_access_6.html
    Flex cookbook beta - Building Flex Applications with SOAP Web
    Services:
    Mar 3, 2008 ... If you are using web services technologies
    then it is usually ... The DataGrid tag instanciates an instance of
    the DataGrid Flex control.
    Link:
    http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&productId=2&postI d=7863
    Flex 3 - Using WebService components:
    The Flex web service API generally supports Simple Object
    Access Protocol (SOAP) ... property of a DataGrid control and
    displayed in the DataGrid control.
    Link:
    http://livedocs.adobe.com/flex/3/html/data_access_3.html
    Adobe - Flex General Discussion:
    Flex datagrid data column / webservice - justneed2know -
    08/27/2008 ... I use a web service to populate a datagrid and its
    columns (on of which is date).
    Link:
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=60&catid=585&threadid =1388794&enterthread=y
    All Classes (Flex 3):
    mx.rpc.soap, AbstractWebService is an abstract base class for
    implementations that provide RPC access to SOAP-based web services.
    Link:
    http://livedocs.adobe.com/flex/3/langref/class-summary.html
    Adobe - Developer Center : Using Flex Builder to Create Web:
    Using Flex Builder to Create Web ServiceBased Flex
    Applications ... The web service result data needs to flow to the
    DataGrid. Select the 'Data will flow
    Link:
    http://www.adobe.com/devnet/flex/articles/flexbuilder_ws_04.html
    Disclaimer: This response is generated automatically by the
    Adobe NewsBot based on Adobe
    Community
    Engine.

  • Print data in Datagrid with AS3

    Dear all,
    I would want to print out all the data inside my Datagrid which were populated in flash AS3. Taking into consideration that my datagrid has horizontalScrollPolicy and verticalScrollPolicy activated, how do I print the whole information?
    This is the closest code I'm looking for, but I had alot of errors when I tried to use it, maybe because it is in AS2 & i convented it wrongly...
    Link: http://www.knowledgesutra.com/forums/topic/29459-print-with-flash-and-datagrids-without-re sizing/
    Do take a look at the code please.
    My convented code from AS2 to AS3:
    import fl.data.DataProvider;
    import fl.controls.DataGrid;
    import fl.controls.ScrollPolicy;
    var dp:DataProvider = new DataProvider();
    var fitPage:Boolean = false;
    dp.addItem({no:"1", Winner_Name:"TestName1", Prize_Title:"TestPrizeTitleTestPrizeNameTestPrizeNameTestPrizeName", Prize_Name:"TestPrizeNameTestPrizeNameTestPrizeName"});
    dp.addItem({no:"1", Winner_Name:"TestName1", Prize_Title:"TestPrizeTitle", Prize_Name:"TestPrizeName"});
    dp.addItem({no:"1", Winner_Name:"TestName1", Prize_Title:"TestPrizeTitle", Prize_Name:"TestPrizeName"});
    dp.addItem({no:"1", Winner_Name:"TestName1", Prize_Title:"TestPrizeTitle", Prize_Name:"TestPrizeName"});
    dp.addItem({no:"1", Winner_Name:"TestName1", Prize_Title:"TestPrizeTitle", Prize_Name:"TestPrizeName"});
    dp.addItem({no:"1", Winner_Name:"TestName1", Prize_Title:"TestPrizeTitle", Prize_Name:"TestPrizeName"});
    dp.addItem({no:"1", Winner_Name:"TestName1", Prize_Title:"TestPrizeTitle", Prize_Name:"TestPrizeName"});
    dp.addItem({no:"1", Winner_Name:"TestName1", Prize_Title:"TestPrizeTitle", Prize_Name:"TestPrizeName"});
    dp.addItem({no:"1", Winner_Name:"TestName1", Prize_Title:"TestPrizeTitle", Prize_Name:"TestPrizeName"});
    dp.addItem({no:"1", Winner_Name:"TestName1", Prize_Title:"TestPrizeTitle", Prize_Name:"TestPrizeName"});
    dp.addItem({no:"1", Winner_Name:"TestName1", Prize_Title:"TestPrizeTitle", Prize_Name:"TestPrizeName"});
    dp.addItem({no:"1", Winner_Name:"TestName1", Prize_Title:"TestPrizeTitle", Prize_Name:"TestPrizeName"});
    dp.addItem({no:"1", Winner_Name:"TestName1TestName1TestName1", Prize_Title:"TestPrizeTitle", Prize_Name:"TestPrizeName"});
    dp.addItem({no:"1", Winner_Name:"TestName1", Prize_Title:"TestPrizeTitle", Prize_Name:"TestPrizeNameTestPrizeNameTestPrizeNameTestPrizeNameTestPrizeName"});
    datagrid.columns = ["no","Winner_Name","Prize_Title","Prize_Name"];
    datagrid.getColumnAt(0).width = 50;
    datagrid.getColumnAt(1).width = 150;
    datagrid.getColumnAt(2).width = 100;
    datagrid.getColumnAt(3).width = 350;
    datagrid.dataProvider = dp;
    datagrid.horizontalScrollPolicy = ScrollPolicy.ON;
    datagrid.setSize(600, 250);
    clickme.addEventListener(MouseEvent.CLICK, clickmeFn)
    function clickmeFn(e:MouseEvent){
         fitPage = true;
         doPrint()
    function doPrint(){
          if (fitPage == false) fitPage = true;
            var pj:PrintJob = new PrintJob();
            // position of currently visible rows stored
            var prev_vPosition:Number = datagrid.verticalScrollPosition;
            var prev_width:Number = datagrid.width;
            var prev_height:Number = datagrid.height;
            var prev_vScroll = datagrid.verticalScrollPolicy;
            var prev_selectedIndex = datagrid.selectedIndex;
            var dgPrintWidth:Number = 0;
            var dgPrintHeight:Number = 0;
            if (pj.start() != true) {
                   return;
            // hide scrollbar for print
            datagrid.verticalScrollPolicy = "off";
            // hide the selection
            datagrid.selectedIndex = undefined;
            // datagrid width for printing
            if (fitPage) {
                   dgPrintWidth = pj.pageWidth;
            } else {
                   if (prev_width < pj.pageWidth) {
                        dgPrintWidth = prev_width;
                   } else {
                        dgPrintWidth = pj.pageWidth;
            // number of rows per view, ignoring fractions (floor)
              var rowsPerPage:Number = Math.floor((pj.pageHeight-datagrid.headerHeight)/datagrid.rowHeight);
            // total number of pages to be printed, if there are any fractions, have one page for that (ceil)
            var total_pages:Number = Math.ceil(datagrid.dataProvider.length/rowsPerPage);
            // number of full pages to be printed, ignoring fractions (floor)
            var full_pages:Number = Math.floor(datagrid.dataProvider.length/rowsPerPage);
            // number of rows on last page if partial
            var last_page_rows:Number = 0;
            // height of last page if partial
            var last_page_height:Number = 0;
            // partial last page ?
            if (total_pages != full_pages) {
                   last_page_rows = datagrid.dataProvider.length - (full_pages*rowsPerPage);
                   last_page_height = datagrid.headerHeight + (datagrid.rowHeight * last_page_rows);
            // datagrid height for printing
            dgPrintHeight = datagrid.headerHeight + (datagrid.rowHeight * rowsPerPage);
            datagrid.setSize(dgPrintWidth, dgPrintHeight);
            for (var i = 0; i<total_pages; i++) {
                   // if last page and partial - resize grid
                   if ((i == total_pages - 1) && (last_page_rows > 0)) {
                        datagrid.setSize(dgPrintWidth, last_page_height);
                   // move the visible row position.
                   datagrid.verticalScrollPosition = i*rowsPerPage;
                   // size box relative to the grid
                   var b = {xMin:0, xMax:datagrid.width, yMin:0, yMax:datagrid.height};
                   if (!fitPage && prev_width < pj.pageWidth) {
                        var x0 = (pj.pageWidth - prev_width) / 2;
                        b = {xMin:(-x0), xMax:(datagrid.width+x0), yMin:0, yMax:datagrid.height};
                   pj.addPage(datagrid, b);
            pj.send();
              pj = null;
           // delete pj;
            // previous scrollPolicy
            datagrid.verticalScrollPolicy = prev_vScroll;
            // position of currently visible rows restored
            datagrid.setSize(prev_width, prev_height);
            datagrid.selectedIndex = prev_selectedIndex;
            datagrid.verticalScrollPosition = prev_vPosition;
    The error I get when I tried to print it:
    TypeError: Error #1034: Type Coercion failed: cannot convert Object@26ec1d31 to flash.geom.Rectangle.
         at _fla::MainTimeline/doPrint()
         at _fla::MainTimeline/clickmeFn()
    Advice needed
    -Zainuu

    var columns:Array = ["Flash", "ActionScript", "Republic of Code"];
         trace(columns);
         //Start printing headers 
         var xPos:Number = 0;
         var tbWidth:Number = 0;
         //leave 2 rows margin at top
         var rowY:Number = _rowHeight * 2;
         for (var i = 0; i < columns.length; i++)
              //define xPos by adding the tbWidth of the last loop
              xPos = xPos + tbWidth;
              var column:DataGridColumn = targetDG.getColumnAt(i);
    //get width of this column
              tbWidth = column.width;
              //add textField
              printClip.createTextField("header_" + i , printClip.getNextHighestDepth(), xPos, rowY,tbWidth, _rowHeight);
              var thisTb:TextField = printClip["header_" + i];
              //thisTb.setNewTextFormat(headerFormat);
              thisTb.defaultTextFormat = headerFormat;
              thisTb.border = true;
              thisTb.borderColor = 0xCCCCCC;
              thisTb.background = true;
              thisTb.backgroundColor = 0xD5EAFF;
              thisTb.text = column.headerText;
    I got this AS2 code and I tried to convent it into AS3 but I have this error..
    1046: Type was not found or was not a compile-time constant: DataGridColumn.
    I have bold the line that causes this error. Anyone knows the solution for this error?

  • Flex datagrid data on datachange

    Hi all,
    I am using an extended datagrid which takes its height on the basis of measured height of items. Item renderer for datagrid is a canvas. Which holds one more canvas(header for item renderer) and a text area. The problem I am facing is with the header canvas in item renderer. Header canvas has one label which diaplay a name of user. On the basis of data provider for the current item visibility of this label in header canvas is set as true or false. issue is when it set to false it repaints(on data change event) all the previous header canvas label also to visible false. And just the last item has the data. Rather it should set its visiblity false only for the current item and rest items sholud behave as value set for them.
    Thanks in advance.

    Adobe Newsbot hopes that the following resources helps you.
    NewsBot is experimental and any feedback (reply to this post) on
    its utility will be appreciated:
    Flex 3 - Handling service results:
    Flex interprets the XML data that a web service or HTTP
    service returns to ..... a DataGrid control with DataTable data
    returned from a .NET web service.
    Link:
    http://livedocs.adobe.com/flex/3/html/data_access_6.html
    Flex cookbook beta - Building Flex Applications with SOAP Web
    Services:
    Mar 3, 2008 ... If you are using web services technologies
    then it is usually ... The DataGrid tag instanciates an instance of
    the DataGrid Flex control.
    Link:
    http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&productId=2&postI d=7863
    Flex 3 - Using WebService components:
    The Flex web service API generally supports Simple Object
    Access Protocol (SOAP) ... property of a DataGrid control and
    displayed in the DataGrid control.
    Link:
    http://livedocs.adobe.com/flex/3/html/data_access_3.html
    Adobe - Flex General Discussion:
    Flex datagrid data column / webservice - justneed2know -
    08/27/2008 ... I use a web service to populate a datagrid and its
    columns (on of which is date).
    Link:
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=60&catid=585&threadid =1388794&enterthread=y
    All Classes (Flex 3):
    mx.rpc.soap, AbstractWebService is an abstract base class for
    implementations that provide RPC access to SOAP-based web services.
    Link:
    http://livedocs.adobe.com/flex/3/langref/class-summary.html
    Adobe - Developer Center : Using Flex Builder to Create Web:
    Using Flex Builder to Create Web ServiceBased Flex
    Applications ... The web service result data needs to flow to the
    DataGrid. Select the 'Data will flow
    Link:
    http://www.adobe.com/devnet/flex/articles/flexbuilder_ws_04.html
    Disclaimer: This response is generated automatically by the
    Adobe NewsBot based on Adobe
    Community
    Engine.

  • Filtering data in DataGrid

    hi
    i am new to AS3. As I was going thru live docs, i was able to
    load data from an xml file into a DataGrid, I want to know how to
    make it clickable - on clicking i want a specific data of a column
    display in a TextArea
    Here is my xml
    <sites>
    <urls link="
    http://www.adobe.com"
    category="Design" />
    <urls link="
    http://www.apple.com"
    category="Cool" />
    <urls link="
    http://www.yahoo.com"
    category="Mail" />
    </sites>
    can somebody help me please.
    Thanks in advance
    krs

    You have to call adg.validateNow() after assigning the
    GroupingCollection as dataProvider to the AdvancedDataGrid and
    before applying the filterFunction.
    It should be like -
    adg.dataProvider = gc;
    adg.validateNow();
    IHierarchicalCollectionView(adg.dataProvider).filterFunction
    = filterFunc;
    IHierarchicalCollectionView(adg.dataProvider).refresh();
    Note: The filter function will be applied to group rows
    also.

  • How to make column headers in table in PDF report appear bold while datas in table appear regular from c# windows forms with sql server2008 using iTextSharp

    Hi my name is vishal
    For past 10 days i have been breaking my head on how to make column headers in table appear bold while datas in table appear regular from c# windows forms with sql server2008 using iTextSharp.
    Given below is my code in c# on how i export datas from different tables in sql server to PDF report using iTextSharp:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    using System.Data.SqlClient;
    using iTextSharp.text;
    using iTextSharp.text.pdf;
    using System.Diagnostics;
    using System.IO;
    namespace DRRS_CSharp
    public partial class frmPDF : Form
    public frmPDF()
    InitializeComponent();
    private void button1_Click(object sender, EventArgs e)
    Document doc = new Document(PageSize.A4.Rotate());
    var writer = PdfWriter.GetInstance(doc, new FileStream("AssignedDialyzer.pdf", FileMode.Create));
    doc.SetMargins(50, 50, 50, 50);
    doc.SetPageSize(new iTextSharp.text.Rectangle(iTextSharp.text.PageSize.LETTER.Width, iTextSharp.text.PageSize.LETTER.Height));
    doc.Open();
    PdfPTable table = new PdfPTable(6);
    table.TotalWidth =530f;
    table.LockedWidth = true;
    PdfPCell cell = new PdfPCell(new Phrase("Institute/Hospital:AIIMS,NEW DELHI", FontFactory.GetFont("Arial", 14, iTextSharp.text.Font.BOLD, BaseColor.BLACK)));
    cell.Colspan = 6;
    cell.HorizontalAlignment = 0;
    table.AddCell(cell);
    Paragraph para=new Paragraph("DCS Clinical Record-Assigned Dialyzer",FontFactory.GetFont("Arial",16,iTextSharp.text.Font.BOLD,BaseColor.BLACK));
    para.Alignment = Element.ALIGN_CENTER;
    iTextSharp.text.Image png = iTextSharp.text.Image.GetInstance("logo5.png");
    png.ScaleToFit(105f, 105f);
    png.Alignment = Element.ALIGN_RIGHT;
    SqlConnection conn = new SqlConnection("Data Source=NPD-4\\SQLEXPRESS;Initial Catalog=DRRS;Integrated Security=true");
    SqlCommand cmd = new SqlCommand("Select d.dialyserID,r.errorCode,r.dialysis_date,pn.patient_first_name,pn.patient_last_name,d.manufacturer,d.dialyzer_size,r.start_date,r.end_date,d.packed_volume,r.bundle_vol,r.disinfectant,t.Technician_first_name,t.Technician_last_name from dialyser d,patient_name pn,reprocessor r,Techniciandetail t where pn.patient_id=d.patient_id and r.dialyzer_id=d.dialyserID and t.technician_id=r.technician_id and d.deleted_status=0 and d.closed_status=0 and pn.status=1 and r.errorCode<106 and r.reprocessor_id in (Select max(reprocessor_id) from reprocessor where dialyzer_id=d.dialyserID) order by pn.patient_first_name,pn.patient_last_name", conn);
    conn.Open();
    SqlDataReader dr;
    dr = cmd.ExecuteReader();
    table.AddCell("Reprocessing Date");
    table.AddCell("Patient Name");
    table.AddCell("Dialyzer(Manufacturer,Size)");
    table.AddCell("No.of Reuse");
    table.AddCell("Verification");
    table.AddCell("DialyzerID");
    while (dr.Read())
    table.AddCell(dr[2].ToString());
    table.AddCell(dr[3].ToString() +"_"+ dr[4].ToString());
    table.AddCell(dr[5].ToString() + "-" + dr[6].ToString());
    table.AddCell("@count".ToString());
    table.AddCell(dr[12].ToString() + "-" + dr[13].ToString());
    table.AddCell(dr[0].ToString());
    dr.Close();
    table.SpacingBefore = 15f;
    doc.Add(para);
    doc.Add(png);
    doc.Add(table);
    doc.Close();
    System.Diagnostics.Process.Start("AssignedDialyzer.pdf");
    if (MessageBox.Show("Do you want to save changes to AssignedDialyzer.pdf before closing?", "DRRS", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation) == DialogResult.Yes)
    var writer2 = PdfWriter.GetInstance(doc, new FileStream("AssignedDialyzer.pdf", FileMode.Create));
    else if (MessageBox.Show("Do you want to save changes to AssignedDialyzer.pdf before closing?", "DRRS", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation) == DialogResult.No)
    this.Close();
    The above code executes well with no problem at all!
    As you can see the file to which i create and save and open my pdf report is
    AssignedDialyzer.pdf.
    The column headers of table in pdf report from c# windows forms using iTextSharp are
    "Reprocessing Date","Patient Name","Dialyzer(Manufacturer,Size)","No.of Reuse","Verification" and
    "DialyzerID".
    However the problem i am facing is after execution and opening of document is my
    column headers in table in pdf report from
    c# and datas in it all appear in bold.
    I have browsed through net regarding to solve this problem but with no success.
    What i want is my pdf report from c# should be similar to following format which i was able to accomplish in vb6,adodb with MS access using iTextSharp.:
    Given below is report which i have achieved from vb6,adodb with MS access using iTextSharp
    I know that there has to be another way to solve my problem.I have browsed many articles in net regarding exporting sql datas to above format but with no success!
    Is there is any another way to solve to my problem on exporting sql datas from c# windows forms using iTextSharp to above format given in the picture/image above?!
    If so Then Can anyone tell me what modifications must i do in my c# code given above so that my pdf report from c# windows forms using iTextSharp will look similar to image/picture(pdf report) which i was able to accomplish from
    vb6,adodb with ms access using iTextSharp?
    I have approached Sound Forge.Net for help but with no success.
    I hope anyone/someone truly understands what i am trying to ask!
    I know i have to do lot of modifications in my c# code to achieve this level of perfection but i dont know how to do it.
    Can anyone help me please! Any help/guidance in solving this problem would be greatly appreciated.
    I hope i get a reply in terms of solving this problem.
    vishal

    Hi,
    About iTextSharp component issue , I think this case is off-topic in here.
    I suggest you consulting to compenent provider.
    http://sourceforge.net/projects/itextsharp/
    Regards,
    Marvin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to export data with column headers in sql server 2008 with bcp command?

    Hi all,
    I want know "how to export data with column headers in sql server 2008 with bcp command", I know how to import data with import and export wizard. when i
    am trying to import data with bcp command data has been copied but column names are not came.
    I am using the below query:-
    EXEC master..xp_cmdshell
    'BCP "SELECT  * FROM   [tempdb].[dbo].[VBAS_ErrorLog] " QUERYOUT "D:\Temp\SQLServer.log" -c -t , -T -S SERVER-A'
    Thanks,
    SAAD.

    Hi All,
    I have done as per your suggestion but here i have face the below problem, in print statment it give correct query, in EXEC ( EXEC master..xp_cmdshell @BCPCMD) it was displayed error message like below
    DECLARE @BCPCMD
    nvarchar(4000)
    DECLARE @BCPCMD1
    nvarchar(4000)
    DECLARE @BCPCMD2
    nvarchar(4000)
    DECLARE @SQLEXPRESS
    varchar(50)
    DECLARE @filepath
    nvarchar(150),@SQLServer
    varchar(50)
    SET @filepath
    = N'"D:\Temp\LDH_SQLErrorlog_'+CAST(YEAR(GETDATE())
    as varchar(4))
    +RIGHT('00'+CAST(MONTH(GETDATE())
    as varchar(2)),2)
    +RIGHT('00'+CAST(DAY(GETDATE())
    as varchar(2)),2)+'.log" '
    Set @SQLServer
    =(SELECT
    @@SERVERNAME)
    SELECT @BCPCMD1
    = '''BCP "SELECT 
    * FROM   [tempdb].[dbo].[wErrorLog] " QUERYOUT '
    SELECT @BCPCMD2
    = '-c -t , -T -S '
    + @SQLServer + 
    SET @BCPCMD
    = @BCPCMD1+ @filepath 
    + @BCPCMD2
    Print @BCPCMD
    -- Print out below
    'BCP "SELECT 
    * FROM   [tempdb].[dbo].[wErrorLog] " QUERYOUT "D:\Temp\LDH_SQLErrorlog_20130313.log" -c -t , -T -S servername'
    EXEC
    master..xp_cmdshell
    @BCPCMD
      ''BCP' is not recognized as an internal or external command,
    operable program or batch file.
    NULL
    if i copy the print ourt put like below and excecute the CMD it was working fine, could you please suggest me what is the problem in above query.
    EXEC
    master..xp_cmdshell
    'BCP "SELECT  * FROM  
    [tempdb].[dbo].[wErrorLog] " QUERYOUT "D:\Temp\LDH_SQLErrorlog_20130313.log" -c -t , -T -S servername '
    Thanks, SAAD.

  • [Forum FAQ] How to configure a Data Driven Subscription which get multi-value parameters from one column of a database table?

    Introduction
    In SQL Server Reporting Services, we can define a mapping between the fields that are returned in the query to specific delivery options and to report parameters in a data-driven subscription.
    For a report with a parameter (such as YEAR) that allow multiple values, when creating a data-driven subscription, how can we pass a record like below to show correct data (data for year 2012, 2013 and 2014).
    EmailAddress                             Parameter                      
    Comment
    [email protected]              2012,2013,2014               NULL
    In this article, I will demonstrate how to configure a Data Driven Subscription which get multi-value parameters from one column of a database table
    Workaround
    Generally, if we pass the “Parameter” column to report directly in the step 5 when creating data-driven subscription.
    The value “2012,2013,2014” will be regarded as a single value, Reporting Services will use “2012,2013,2014” to filter data. However, there are no any records that YEAR filed equal to “2012,2013,2014”, and we will get an error when the subscription executed
    on the log. (C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\LogFiles)
    Microsoft.ReportingServices.Diagnostics.Utilities.InvalidReportParameterException: Default value or value provided for the report parameter 'Name' is not a valid value.
    This means that there is no such a value on parameter’s available value list, this is an invalid parameter value. If we change the parameter records like below.
    EmailAddress                        Parameter             Comment
    [email protected]         2012                     NULL
    [email protected]         2013                     NULL
    [email protected]         2014                     NULL
    In this case, Reporting Services will generate 3 reports for one data-driven subscription. Each report for only one year which cannot fit the requirement obviously.
    Currently, there is no a solution to solve this issue. The workaround for it is that create two report, one is used for view report for end users, another one is used for create data-driven subscription.
    On the report that used create data-driven subscription, uncheck “Allow multiple values” option for the parameter, do not specify and available values and default values for this parameter. Then change the Filter
    From
    Expression:[ParameterName]
    Operator   :In
    Value         :[@ParameterName]
    To
    Expression:[ParameterName]
    Operator   :In
    Value         :Split(Parameters!ParameterName.Value,",")
    In this case, we can specify a value like "2012,2013,2014" from database to the data-driven subscription.
    Applies to
    Microsoft SQL Server 2005
    Microsoft SQL Server 2008
    Microsoft SQL Server 2008 R2
    Microsoft SQL Server 2012
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    For every Auftrag, there are multiple Position entries.
    Rest of the blocks don't seems to have any relation.
    So you can check this code to see how internal table lt_str is built whose first 3 fields have data contained in Auftrag, and next 3 fields have Position data. The structure is flat, assuming that every Position record is related to preceding Auftrag.
    Try out this snippet.
    DATA lt_data TYPE TABLE OF string.
    DATA lv_data TYPE string.
    CALL METHOD cl_gui_frontend_services=>gui_upload
      EXPORTING
        filename = 'C:\temp\test.txt'
      CHANGING
        data_tab = lt_data
      EXCEPTIONS
        OTHERS   = 19.
    CHECK sy-subrc EQ 0.
    TYPES:
    BEGIN OF ty_str,
      a1 TYPE string,
      a2 TYPE string,
      a3 TYPE string,
      p1 TYPE string,
      p2 TYPE string,
      p3 TYPE string,
    END OF ty_str.
    DATA: lt_str TYPE TABLE OF ty_str,
          ls_str TYPE ty_str,
          lv_block TYPE string,
          lv_flag TYPE boolean.
    LOOP AT lt_data INTO lv_data.
      CASE lv_data.
        WHEN '[Version]' OR '[StdSatz]' OR '[Arbeitstag]' OR '[Pecunia]'
             OR '[Mita]' OR '[Kunde]' OR '[Auftrag]' OR '[Position]'.
          lv_block = lv_data.
          lv_flag = abap_false.
        WHEN OTHERS.
          lv_flag = abap_true.
      ENDCASE.
      CHECK lv_flag EQ abap_true.
      CASE lv_block.
        WHEN '[Auftrag]'.
          SPLIT lv_data AT ';' INTO ls_str-a1 ls_str-a2 ls_str-a3.
        WHEN '[Position]'.
          SPLIT lv_data AT ';' INTO ls_str-p1 ls_str-p2 ls_str-p3.
          APPEND ls_str TO lt_str.
      ENDCASE.
    ENDLOOP.

  • DataGrid data can not be selected after inlcluded automation library

    In order to use QTP for my Flex project, I included the automation libraries.
    But I found that the data in DataGrid can not be selected, and double click function not working.
    After I excluded the following two of the automation libraries, it works fine.
    automation_agent.swc
    qtp.swc
    FLex SDK version:  4.1.0.16076
    Anyone can help?

    It occurred to me that this might be a permissions problem - I had repaired permissions using TechTool Pro a few days ago and that may have caused this - who knows!
    Anyway, I'm just re-repairing permissions using Disk Utility. It says 'Estimated Time: 3 hours' which considering previous permissions repair seems a long time - maybe that is an indication of the problem.
    I'll post again in 3 hours!

  • Dates in column headers based on passed-in parameters

    I am trying to display a query that views performance data for a specified time range, with one day per column and the day's notation ('MON-DD') in the column header. Instead of giving myself a nightmarish query with a variable number of columns, I am starting with just 2 weeks worth and using DATE, DATE-1, DATE-2, etc. to derive the column data.
    I can get everything to display just fine if I use SYSDATE, or just DATE, but I can't seem to figure out how to use DATE -1, etc. in the column headers. I have even tried creating hidden page items to calculate DATE -1 and referencing those in the column headers, but while the references work fine, the calculations error out. Again, the data is fine, it is just the column headers I am struggling with.
    Thanks for any ideas.

    The SYSDATE - 1, SYDATE -2 works great in the report I have that goes back two weeks from the current day. The one I am stuck on is an alternate version of the report where I need it to go back 2 weeks from a date I let the user supply. This is the part that is killing me. SYSDATE -1 etc, processes just fine, but I can't figure out the syntax, etc. for using a page item instead of a constant/predefined SQL query.
    The posted idea is also what I currently use in the working report and is brilliant. What I can't seem to get figured out is how to populate the hidden items with calculated values based on a page item (the passed in date).

  • Create column headers in report based on data entered in Form

    Hi,
    I have a form with following fields being entered into a table: -- a start date for a project and then projected hours required on a monthly basis for X months
    Start Date mnth1_resource mnth2_resource mnth3_resource ...
    2/12/2011 30 20 80 ...
    6/3/2011 80 30 70
    3/12/2011 50 70 60
    4/10/2011 40 120 90
    I would like to create a report (interactive or otherwise) that will provide headers for the actual months of the calendar showing the full range of months to cover the dates included in the data: e.g. if the above data was the only data entered then:
    Feb Mar Apr May Jun Jul Aug Sept
    30 20 80
    50 70 60
    40 120 90
    80 30 70
    Where mnth1 is the month of the start of the project--
    Would appreciate any hints on how to accomplish this.
    Thanks,
    Pat

    Hi,
    Thanks for the response. I see how a crosstab type report works great for data that is static and all in the table, however, in my case the issue is that the columns will vary depending on the start date of the project. So even though the user is only entering 12 months of projection, the total number of columns will depend on the start date of the latest project. For example, if a project does not start till June of 2011 and goes out 12 months, the actual column headers will need to go out to May 2012. Likewise the first column will be dependent on the earliest start date month-- like Feb 2011 in the sample data.
    Pat

Maybe you are looking for

  • "instead of" trigger on a view with a condition

    I'm trying to create an instead-of trigger on a view but I want it all such that: 1. It fires only for a certain condition. 2. When the condition isn't met, I want the normal DML on the view to continue as it normally would. 3. I want to avoid writin

  • Sp_send_dbmail does not work with attachment

    Using sql server 2012.  I am using the following code to send query results as attachment to an email. It works in one of my sproc and does not work in the other. The only difference is the query, the attachment file name, subject and body message. b

  • K7N2 Temperature Problems

    I'm having some small temperature problems with this board. Here are the temps CPU:        45-60 (normal-load)'c Case:       38-45 Chipset:    42-47 The CPU isn't too bad, although I do see some strage fluctuations, like while writing this, its went

  • Synching Outlook Calendar

    Hello. I recently started using a Palm 700p Treo and I anm getting duplicate entries on my desktop and nothing on the Palm calendar. Does anybody have any recommendations? Thanks for your help. Post relates to: Treo 700p (Verizon)

  • Hidden icons how to unhide

    I have, in error, 'hidden' my lock keypad icon on my 8320 and can't seem to find a way to get it back. Please help, thanks a very stressed out 8320 user. BTW please use non-tch and simple steps as I am obviously an airhead!!