Setting body directly without using multipart classes

I want to be able to send mail using JavaMail by just setting the header and body. I do not want to care about multi-part and the like.
As an example, whatever be the main content-type, I set that in the header, and set the whole body as a string.
Example, for the following, I want to just set "multipart/alternative" and set the following as text, and it should handle it.
------_=_NextPart_001_01C63EA7.9A5D7BC9
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
=20
------_=_NextPart_001_01C63EA7.9A5D7BC9
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<META content=3D"MSHTML 6.00.3790.2577" name=3DGENERATOR></HEAD>
<BODY>
<DIV> </DIV></BODY></HTML>
------_=_NextPart_001_01C63EA7.9A5D7BC9--
Is there a way to do it?

Are you trying to make it difficult on purpose? :-)
I suspect you could use a ByteArrayDataSource with the appropriate
content type and content data and then set that as the content for the
message itself:
msg.setDataHandler(new ByteArrayDataSource(myText, myMIMEtype));

Similar Messages

  • Using Custom Legend without Using Legend Class for line Chart

    Hi ,
    I m trying to create legend with checkbox without using Legend class of flex, but problem is that how to use itemrenderer of lineseries in the legend.
    My requirement is like this:

    my problemb is how to get that shape and use in container .
    i am using hbox in that i have checkbox ,label and i tried to use Image or IFlexDisplayObject but i am unable to assign that renderer to either  image or IFlexDisplayOBject nothing isd working.
    any suggestion for what component i shall use to assign the itemrenderer of lineseries.
    Thanks for replying

  • Using text in a GUI without using .swing classes

    In a Java application, is there any way to create a text object that can be positioned in a GUI like an ImageIcon (using a class from the standard Java API)? For example, when using ImageIcon, you feed the x and y-coordinates, whereas with .swing, you'd have to create a new panel, position the panel, and re-position the panel using BorderLayout.(direction).
    Ex. (with ImageIcon, you'd place it like so):
    //construct ImageIcon w/ URL
    ImageIcon myImage = new ImageIcon(new URL("http://..."));
    //x and y are pixels to the right and to the bottom from the top left corner
    myImage.paintIcon( (Component), (Graphics), x, y);
    //I'm looking for one that does the same, like this (without using an image, preferrably), TextMessage is what the class might be:
    TextMessage myText = new TextMessage("Here is some string to print out");
    myText.printText( (Component), (Graphics), x, y)

    or you can paint a string, like this
    public void paint(Graphics g) {
         super.paint(g);
         g.drawString("Hello World!", x,y);  // replace x, y with your own coordinates
    }hope that helps

  • Set Cell Color without using DefaultTableCellRenderer

    Hi,
    Is there any possible to set the JTable cell color without using DefaultTableCellRenderer ?. For ex, I have one JTable that having 9 rows and 9 columns. I have to set the cell color in 2nd row & 3rd column.
    Please anyone give me guidance to solve this.
    Thanks & Regards
    S Senthilkumar

    Fine.. Please try to understand my points.
    Because in my application I have JTable that having 10 columns and rows dynamically will come based on the value fetch from arraylist. If I use DefaultTableCellRenderer, for each record its calling CustomTableCellRenderer(). For example arraylist return 10 rows means its looping 100 times(10 rows * 10 columns).
    CustomTableCellRenderrer.java
    ArrayList dataLiveMarket = (ArrayList) new CheckUser().getLiveMarketDetails(unval);
    CustomTableModel modelLiveMarket = new CustomTableModel(dataLiveMarket);
    JTable tableOne = new JTable(modelLiveMarket);
    tableOne.setDefaultRenderer(Object.class, new CustomTableCellRenderer());
    CustomTableCellRenderrer.java
    package com.fxtrading.dao;
    import java.awt.Color;
    import java.awt.Component;
    import javax.swing.JTable;
    import javax.swing.SwingConstants;
    import javax.swing.table.DefaultTableCellRenderer;
    import javax.swing.table.TableModel;
    * @author user
    public class CustomTableCellRenderer extends DefaultTableCellRenderer {
        //private TableModel bidLastPrice;
        //int k;
        @Override
        public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
                boolean hasFocus,
                int row, int column) {
            Component component =
                    super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
            if (column == 0 || column == 1|| column == 2) {
                setHorizontalAlignment(SwingConstants.LEFT);
            } else if(column == 3 || column == 4 || column == 5 || column == 6 || column == 7 || column == 8){
                setHorizontalAlignment(SwingConstants.RIGHT);
            }else if(column == 9){
                setHorizontalAlignment(SwingConstants.CENTER);
            // Change cell Color - Started
            bidLastPrice = table.getModel();
            int bidLastRowCount =(int)table.getRowCount();
            for(k=0; k<bidLastRowCount; k++) {
                String bidPrice = (String)bidLastPrice.getValueAt(k,4);
                String lastPrice = (String)bidLastPrice.getValueAt(k,8);
                bidPrice = bidPrice.replace(",","").replace("$","");
                lastPrice = lastPrice.replace(",","").replace("$","");
                if(Double.parseDouble(bidPrice)<Double.parseDouble(lastPrice)){
                    if(row == k && column == 4){
                        component.setBackground(Color.RED);                   
                    }else{
                        component.setBackground(Color.WHITE);
                    System.out.println("Row Count -->"+k+" Less ----> Bid Price----> "+Double.parseDouble(bidPrice)+" : Last Price----> "+Double.parseDouble(lastPrice));
                }else{
                    if(row == k && column == 4){                  
                        component.setBackground(Color.GREEN);
                    }else{
                        component.setBackground(Color.WHITE);
                    System.out.println("Row Count -->"+k+" More ----> Bid Price----> "+Double.parseDouble(bidPrice)+" : Last Price----> "+Double.parseDouble(lastPrice));
            // Change cell Color - End
            return component;
    }Thanks & Regards,
    S Senthilkumar

  • How to set item values without using fields in branch's ACTION block?

    Okay, I will try to say this in a easy way so it is not weird.
    I have created a button, SAVE, that has a Branch of branch type: Branch To Function Returning A Page. This is my code for the branch:
    if :P2008_NAP_SUPPORTING_MATERIALS = 'Yes' then
    return '2092';
    else
    return '2040';
    end if;
    The code for this type of branch is stored in the ACTION block of the Branch page. The ACTION block for a Branch of branch type: Branch To Function Returning A Page is different than the ACTION block for a Branch of branch type: Branch To Page Or URL.
    I need to set some item values with some specific values, which I can do with a branch type: Branch To Page Or URL. This is not possible with the branch type: Branch To Function Returning A Page. The ACTION block is totally different.
    How can I set some values on say Page 2040 from Page 2008 without using fields in the branch's ACTION block?
    Thank you in advance,
    Maggie

    Andy and Scott,
    I love seeing different perspectives in solving problems, it opens my eyes to new ways of looking at/using the tools (reserved words and 'Function returning a Page', etc.).
    One of my pet peeves has been that on branches I was limited to only 10 variables to be passed (I know, who would want more - but there was an instance where I had to pass more), and an even more frustrating time when using report Column Linking, which limits me to 3 variables.
    At least with the Branch linking I can use your suggestion Andy and add the variable setting statements into the function. I am assuming of course (and I should be able to) that I will be able to set more that 10 variables in a IF condition prior to the RETURN statement. This method will be much more understandable, for me, when looking through the branch at a later time to see what is happening, than an URL link where all the variable are strung out 'in a line' so to speak.
    I will still need to use URL Target branching on Links contained within a Column Attribute when I need to pass more than 3 variables, of which I have several places where I do this.
    Thomas

  • How to hide the field using internalname or directly without using SPD

    Hi there,
    I like to customize my form and hide some fields using the InternalName; it would be great if you can provide me tips / instructions.
    PS: I dont have SharePoint Designer access; so please provide suggestions without using SPD 2010
    Thanks
    DMlv

    You can do it using jquery based on Title attribute of the field by adding content editor webpart on the form and writing your jquery there. Will that be fine with you ?
    If yes below are the pointers
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/50aa6f8d-f742-4400-82f3-7949ab1c215e/need-help-manipulating-form-fieldsrows-using-jquery?forum=sharepointdevelopmentprevious#802d9d4d-c19b-4752-a4fb-e38f40f50c51
    http://ptsharepoint2010.blogspot.in/2010/04/hide-fields-from-newformaspx-and.html
    http://sachinvkatkar.blogspot.in/2013/02/hide-fields-from-sharepoint-newform.html
    Geetanjali Arora | My blogs |

  • SharePoint 2013 Media Player using UNC path directly without using a Website in IIS (either out of the box or custom player using javascript only)

    Hi,
    There isn't much info on this and I am hoping its possible.
    I have come across the following article which explains how we can setup SharePoint 2013 Asset Library using video links using a website in IIS that is mapped to a UNC path.
    http://stevemannspath.blogspot.com.au/2012/12/sharepoint-2013-videos-in-sharepoint.html
    This is great. However we have an issue where I work and I need somehow to get SharePoint mediaplayer to point to a video directly using the UNC path like :- \\WINSP13\TempVideos\NTV_Carr_Indig.wmv without the use of a website in IIS.
    I understand that we won't be able to stream the video then thats ok.
    when trying to add a video link to an asset library using the UNC path, we get the following error: We don't support
    playing a video of that format from a file share.
    Is there a way or a workaround to do this? we are using only javascript to do this (AngularJS or any custom Javascript player such as MediaElement)
    Thanks
    Kind Regards,
    Will

    From a SharePoint architecture perspective, this is a BAD design, since you are rerouting the communications (from the client to the UNC) away from and outside of SharePoint... as a result, SP cannot provide any level of guarantee about the ability for videos
    to play on the client machine.
    Secondarily, I'm not sure that the browser will let you pull resources from such different locations (doing so has been the root of several type of attacks, such as "Cross Site Scripting").
    That said (and assuming the browser lets you), you can always use JS to handle creating the video player HTML and setting the UNC location... instead of using a site asset library to store the links, just create a list for the videos
    Scott Brickey
    MCTS, MCPD, MCITP
    www.sbrickey.com
    Strategic Data Systems - for all your SharePoint needs

  • How can I resize an array directly (without using reshape array)?

    Hi everyone,
    I have a porgam in which I am using an array as a command (with specific values that the user enters before running the program). By mistake, at the beginning I created a 4 dimension array (for instance), but I didn't know because I was only showing the first 3 values (not expanding the array to 4 or more). I would now like to change the size of the array from 4 to 3. I don't seem to be able to find an option (right clicking on the array) that enables me to do this directly. I don't want to use the "reshape array" icon, because this is not what I want to do. I hope I am clear enough.
    Thanks for any help,
    regards,
    Marc
    Solved!
    Go to Solution.
    Attachments:
    Forum array.vi ‏7 KB

    HI,
              If i have understood your question hope this helps you. If you want to change the size of the array right click on the array element and click Data Operations>Delete Element or if you want to do programmatically delete the particular element.
    Attachments:
    Forum%20array[1].vi ‏11 KB

  • I wanted to trigger Email Action directly without using any Job or Job Event. Want to execute using REST API only.

    Is it possible to execute Email Action and set its component like Subject,EmailTo,Email From using REST API only ?
    Please help me out with this.

    Hi,
    The DBA_SCHEDULER_NOTIFICATIONS show the notification settings, not the notifications that were sent. To see that, run the follwoing query:
    select queue,
           msg_state,
           enq_time,
           enq_user_id,
           deq_time,
           deq_user_id,
           t.user_data.event_type,
           t.user_data.object_owner,
           t.user_data.object_name,
           t.user_data.event_timestamp
      from sys.AQ$SCHEDULER$_EVENT_QTAB t;
    Does it show anything for your job?

  • FILLING an area  without using SHAPE class

    I am trying to implement the fill operation in a drawing application.
    but I am not using the SHAPE class and also I do not know the co-ordinates.
    I have just a very faint idea of implementing it, but am not able to path myself out.
    If any appropriate method strikes to any of being, please pass on that to me kindly.
    Thanks
    Rgds
    Ashwin

    I think doing the fill operation in the paint() method is a very bad idea... how will yoou keep track of the fill action for the next time the paint() wil be called ?
    In fact, you have two solutions:
    1) Keep track in an array (or vectors or array list) of every object you create in your drawing tool. For example:
    Object 1: Rectangle, bounds=[10,5,100,200], color=blue, fill=false
    Object 2: Circle, bounds=[80,45,30,30], color=red, fill=false
    Object 3: Shape, bounds=[10,5,50,60], color=green, fill=true
    In this case, your paint() method only has to loop thru the objects and do the paintings accordingly.
    2) Only keep track of the graphic area. The paint() method first has to recover the previous graphic area, then do the new paint action, and finally backup the graphic area. For example:
       // Call the superclass painting
       super.paintComponent(g);
       // Paint the previous graphic area
       if (oldGraphics != null) g.drawImage(previousGraphics);
       // Paint the new object
       doPaintAction(g);
       // backup the graphic area
       // NOTE: You'll have to find a way to get an image
       // of the graphic area!
       previousGraphics = getGraphicImage(g);Hope this helped,
    Regards

  • Uploading a file without using multipart request

    I want to upload a xml file from my java application(standalone, no webserver involved) ... please suggest. I am able to do it through servlet multipart request but don't want to continue with that just to bypass the browser interaction the client have to perform to choose the said file.
    thanks

    Upload to what? You need something running on the machine where the file is to be uploaded to. If it's not a web server, then you'll have to run something else. Once you decide what that is going to be, then you will have to change your program to send the XML file to that server.

  • Setting threshhold value without using grid

    Hi
    if I create manual database how to set threshold value?
    is there any other tool to set threshold value?

    935025 wrote:
    Hi
    if I create manual database how to set threshold value?
    is there any other tool to set threshold value?what threshold value?
    post URL where it is documented.

  • How to print the report directly without previewing (report viewer) using c# windows application

    Hi,
    Currently, we are using crystal report to all of our reporting applications, but since I/users have encountered some issues about CR's speed to load only a simple report, maybe it is now time for us to adopt a new reporting environment in which I think SSRS
    can fill this problem.
    To start with, I have here a sample code, that uses the crystal report to print the report directly without previewing:
    csCashInvoiceCal csCashCal; --Crystal report name .rpt
    dsCsReceipt dsCs; --created dataset
    DataTable u;
    DataRow s;
    private System.Drawing.Printing.PrintDocument printDocument1;
    private System.Windows.Forms.PrintDialog printDialog1;
    ParameterValues paramValue;
    ParameterDiscreteValue discreteValue;
    ParameterFieldDefinition fieldDefinition;
    private void btnPrint_Click(object sender, EventArgs e)
    this.Cursor = Cursors.WaitCursor;
    loadReceipt2();
    print2();
    csCashCal.Close();
    this.Cursor = Cursors.Default;
    private void loadReceipt2()
    dsCs = new dsCsReceipt(); --created dataset
    u = dsCs.Tables.Add("DtCsReceipt");
    u.Columns.Add("Qty", Type.GetType("System.String"));
    u.Columns.Add("UOM", Type.GetType("System.String"));
    u.Columns.Add("Description", Type.GetType("System.String"));
    u.Columns.Add("UnitPrice", Type.GetType("System.String"));
    u.Columns.Add("Discount", Type.GetType("System.String"));
    u.Columns.Add("Amount", Type.GetType("System.String"));
    try
    for (int i = 0; i < dgvDesc.Rows.Count - 1; i++)
    s = u.NewRow(); double.TryParse(dgvDesc.Rows[i].Cells[Discount2.Name].Value.ToString(), out discount);
    s["Qty"] = double.Parse(dgvDesc.Rows[i].Cells[Qty.Name].Value.ToString());
    s["UOM"] = dgvDesc.Rows[i].Cells[Uom2.Name].Value.ToString();
    s["Description"] = invcode + dgvDesc.Rows[i].Cells[Description.Name].Value.ToString();
    s["UnitPrice"] = dgvDesc.Rows[i].Cells[UnitPrice.Name].Value.ToString();
    if (discount != 0)
    s["Discount"] = "(" + string.Format("{0:0.##}", discount) + "%)";
    else
    s["Discount"] = "";
    s["Amount"] = dgvDesc.Rows[i].Cells[Amount2.Name].Value.ToString();
    u.Rows.Add(s);
    catch (Exception) { }
    csCashCal = new csCashInvoiceCal();
    csCashCal.SetDataSource(dsCs.Tables[1]);
    //csCashCal.Refresh();
    loadParameter2();
    private void loadParameter2()
    ParameterFieldDefinitions paramFieldDefinitions;
    paramValue = new ParameterValues();
    discreteValue = new ParameterDiscreteValue();
    paramFieldDefinitions = csCashCal.DataDefinition.ParameterFields;
    discreteValue.Value = date;
    fieldDefinition = paramFieldDefinitions["Date"];
    commonParam();
    discreteValue.Value = txtcsno.Text;
    fieldDefinition = paramFieldDefinitions["InvoiceNo"];
    commonParam();
    discreteValue.Value = txtNameTo.Text;
    fieldDefinition = paramFieldDefinitions["CustomerName"];
    commonParam();
    discreteValue.Value = txtAdd.Text;
    fieldDefinition = paramFieldDefinitions["CustomerAddress"];
    commonParam();
    ------other parameters----
    private void commonParam()
    paramValue.Clear();
    paramValue.Add(discreteValue);
    fieldDefinition.ApplyCurrentValues(paramValue);
    private void print2()
    using (printDocument1 = new System.Drawing.Printing.PrintDocument())
    using (this.printDialog1 = new PrintDialog())
    //this.printDialog1.UseEXDialog = true;
    this.printDialog1.Document = this.printDocument1;
    DialogResult dr = this.printDialog1.ShowDialog();
    if (dr == DialogResult.OK)
    int nCopy = this.printDocument1.PrinterSettings.Copies;
    int sPage = this.printDocument1.PrinterSettings.FromPage;
    int ePage = this.printDocument1.PrinterSettings.ToPage;
    string PrinterName = this.printDocument1.PrinterSettings.PrinterName;
    try
    csCashCal.PrintOptions.PrinterName = PrinterName;
    csCashCal.PrintToPrinter(nCopy, false, sPage, ePage);
    printcount++;
    //saveCountPrint();
    catch (Exception err)
    MessageBox.Show(err.ToString());
    This is only a simple sales receipt application that uses dgv and textboxes to push its data to dataset to the crystal report, a simple one but there are instances that it is very slow.
    But I'm having trouble implementing this using SSRS, since I'm only new to this one, wherein I created the report using report wizard, with two button options inside the form for print preview or direct print selection. Actually, it is very easy to implement
    with print preview because it uses reportviewer. My problem is that how can I print the report directly without using a reportviewer?
    So here is my code so far which I don't know what's next:
    private void button2_Click(object sender, EventArgs e)
    this.Cursor = Cursors.WaitCursor;
    loadReceipt3();
    //print3();
    this.Cursor = Cursors.Default;
    ReportParameter[] parameter = new ReportParameter[11];
    private void loadParameter3()
    parameter[0] = new ReportParameter("InvoiceNo", txtcsno.Text);
    parameter[1] = new ReportParameter("Date", date);
    parameter[2] = new ReportParameter("CustomerTin", txtTin.Text);
    parameter[3] = new ReportParameter("CustomerName", txtNameTo.Text);
    parameter[4] = new ReportParameter("CustomerAddress", txtAdd.Text);
    parameter[5] = new ReportParameter("Agent", agent);
    parameter[6] = new ReportParameter("Discount", "Discount: ");
    parameter[7] = new ReportParameter("TotalDiscount", lblDiscount.Text + "%");
    parameter[8] = new ReportParameter("TotalSales", rdtotal);
    parameter[9] = new ReportParameter("Tax", rdtax);
    parameter[10] = new ReportParameter("TotalAmount", rdnet);
    private void loadReceipt3()
    DataSet dsrs = new DataSet();
    DataTable dtrs = new DataTable();
    DataRow drs;
    dtrs.Columns.Add("Qty", Type.GetType("System.String"));
    dtrs.Columns.Add("UOM", Type.GetType("System.String"));
    dtrs.Columns.Add("Description", Type.GetType("System.String"));
    dtrs.Columns.Add("UnitPrice", Type.GetType("System.String"));
    dtrs.Columns.Add("Discount", Type.GetType("System.String"));
    dtrs.Columns.Add("Amount", Type.GetType("System.String"));
    try
    for (int i = 0; i < dgvDesc.Rows.Count - 1; i++)
    drs = dtrs.NewRow();
    drs["Qty"] = double.Parse(dgvDesc.Rows[i].Cells[Qty.Name].Value.ToString());
    drs["UOM"] = dgvDesc.Rows[i].Cells[Uom2.Name].Value.ToString();
    drs["Description"] = invcode + dgvDesc.Rows[i].Cells[Description.Name].Value.ToString();
    drs["UnitPrice"] = dgvDesc.Rows[i].Cells[UnitPrice.Name].Value.ToString();
    if (discount != 0)
    drs["Discount"] = "(" + string.Format("{0:0.##}", discount) + "%)";
    else
    drs["Discount"] = "";
    drs["Amount"] = dgvDesc.Rows[i].Cells[Amount2.Name].Value.ToString();
    dtrs.Rows.Add(s);
    catch (Exception) { }
    int addtlRow = 7;
    if (addtlRow > (count - 1))
    addtlRow = addtlRow - (count - 1);
    for (int i = 0; i < addtlRow; i++)
    dtrs.Rows.Add();
    loadParameter3();
    LocalReport localreport = new LocalReport();
    localreport.SetParameters(parameter);
    localreport.DataSources.Clear();
    localreport.DataSources.Add(new ReportDataSource("dsSalesReceiptSsrs", dtrs));
    localreport.Refresh();
    //what's next....
    So what's next after local..refresh()? Actually, I have googled a lot but I didn't found the exact solution that I'm looking for which confuses me a lot.
    Anyway I'm using VS 2010 with sql server 2012 express.
    You're help will be greatly appreciated.
    Thank you,
    Hardz

    After some further studies with ReportViewer controls and with the use of this tutorial @ : http://msdn.microsoft.com/en-us/library/ms252091.aspx, which helps me a lot on how to print a report without using a report viewer, I found out what is missing
    with my code above and helps solve my question.
    Here's the continuation of the code above:
    private void loadReceipt3()
    loadParameter3();
    LocalReport localreport = new LocalReport();
    localreport.ReportPath = @"..\..\SsrsCashReceipt.rdlc";
    localreport.SetParameters(parameter);
    localreport.DataSources.Clear();
    localreport.DataSources.Add(new ReportDataSource("dsSalesReceiptSsrs", dtrs));
    Export(localreport);
    print4();
    private IList<Stream> m_streams;
    private int m_currentPageIndex;
    private void Export(LocalReport report)
    string deviceInfo =
    @"<DeviceInfo>
    <OutputFormat>EMF</OutputFormat>
    <PageWidth>8.5in</PageWidth>
    <PageHeight>11in</PageHeight>
    <MarginTop>0.25in</MarginTop>
    <MarginLeft>0.25in</MarginLeft>
    <MarginRight>0.25in</MarginRight>
    <MarginBottom>0.25in</MarginBottom>
    </DeviceInfo>";
    Warning[] warnings;
    m_streams = new List<Stream>();
    report.Render("Image", deviceInfo, CreateStream,
    out warnings);
    foreach (Stream stream in m_streams)
    stream.Position = 0;
    private void print4()
    if (m_streams == null || m_streams.Count == 0)
    throw new Exception("Error: no stream to print.");
    PrintDocument printDoc = new PrintDocument();
    PrintDialog printDlg = new PrintDialog();
    printDlg.Document = printDoc;
    DialogResult dr = printDlg.ShowDialog();
    if (dr == DialogResult.OK)
    if (!printDoc.PrinterSettings.IsValid)
    throw new Exception("Error: cannot find the default printer.");
    else
    printDoc.PrintPage += new PrintPageEventHandler(PrintPage);
    m_currentPageIndex = 0;
    printDoc.Print();
    Dispose();
    public void Dispose()
    if (m_streams != null)
    foreach (Stream stream in m_streams)
    stream.Close();
    m_streams = null;
    private Stream CreateStream(string name, string fileNameExtension, Encoding encoding, string mimeType, bool willSeek)
    Stream stream = new FileStream(name + "." + fileNameExtension,
    FileMode.Create);
    m_streams.Add(stream);
    return stream;
    private void PrintPage(object sender, PrintPageEventArgs ev)
    Metafile pageImage = new
    Metafile(m_streams[m_currentPageIndex]);
    // Adjust rectangular area with printer margins.
    Rectangle adjustedRect = new Rectangle(
    ev.PageBounds.Left - (int)ev.PageSettings.HardMarginX,
    ev.PageBounds.Top - (int)ev.PageSettings.HardMarginY,
    ev.PageBounds.Width,
    ev.PageBounds.Height);
    // Draw a white background for the report
    ev.Graphics.FillRectangle(Brushes.White, adjustedRect);
    // Draw the report content
    ev.Graphics.DrawImage(pageImage, adjustedRect);
    // Prepare for the next page. Make sure we haven't hit the end.
    m_currentPageIndex++;
    ev.HasMorePages = (m_currentPageIndex < m_streams.Count);
    Thank you very much for this wonderful tutorial. :)

  • I am download ios 8.1.2 direct in my laptop without using itunes. how i can update my iphone 4s with this ios 8.1.2 setup

    i am download ios 8.1.2 in my laptop drive direct without using itunes.how i can install this ios 8.1.2 from my laptop drive

    You need to update your phone before you can restore the backup of his phone to it. Update your phone to iOS 8.0.2 and then you will see both backups as options.
    You can restore a backup created with an older version of iOS to a phone running a newer version but cannot go the other way.
    ~Lyssa

  • Database connectivity without using Class.forName()

    Hi,
    Can anyone please tell how we can connect to a database without in java without using the Class.forName() method , and then how the database driver gets loaded.
    Regards,
    Tanmoy

    Hi,
    I recently wrote code that connects to a database without using Class.forName() in order to be compatible with Microsoft's JVM. I read about it here:
    http://www.idssoftware.com/faq-e.html#E1
    Basically, you create a new Driver object and use its connect method.
    Here's what my particular code ended up being:
    String url = "jdbc:mysql://localhost:3306/test?user=root&password=mypass";
    Driver drv = new org.gjt.mm.mysql.Driver();
    Connection con = drv.connect(url,null);

Maybe you are looking for