Windows forms treeview filtering problem

Hi,
I have a textbox and treeview in C# windows form application. What i want to do is , due to the text data entered in the textbox, the treeview will automatically locate to the entered data dynamically. While i'm  typing , the treeview will refresh itself
with only the matching nodes with the criteria entered.
I couldn't find a way to do this. 
Waiting for help,
HighHopes

Hi HighHopes,
What's the relationship between the textBox and TreeView, is the treeview populated(databind) by some dataSource?
First, I think it's better to use ComboBox control instead of TextBox to select and enter text, and then highlight the node in TreeView if its text the same with the node's text.
private void comboBox1_TextChanged(object sender, EventArgs e)
for (int i = 0; i < treeView1.Nodes.Count; i++)
treeView1.Nodes[i].ForeColor = Color.Black;
for (int k = 0; k < treeView1.Nodes[i].Nodes.Count; k++)
treeView1.Nodes[i].Nodes[k].ForeColor = Color.Black;
if (comboBox1.Text == "") return;
if (comboBox1.Text.Length <= 2) return;
for (int i = 0; i < treeView1.Nodes.Count; i++)
if (treeView1.Nodes[i].Text.IndexOf(comboBox1.Text) >= 0)
treeView1.Nodes[i].ForeColor = Color.Blue;
break;
for (int k = 0; k < treeView1.Nodes[i].Nodes.Count; k++)
if (treeView1.Nodes[i].Nodes[k].Text.IndexOf(comboBox1.Text) >= 0)
treeView1.Nodes[i].Nodes[k].ForeColor = Color.Blue;
break;
Helen Zhou [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

Similar Messages

  • Why do I get a MissingMan​ifestResou​rceExcepti​on when I try to use an MFC Control Wrapper in a Windows Forms Project with Measuremen​t Studio 7.0?

    I can use the .NET Windows Forms Controls without problems, but when I try to add an MFC control, everything appears to work fine until runtime. The program throws the aforementioned exception claiming that the resources haven't been added to the compiled project. Any help is appreciated. Thanks.
    Victor

    That is correct that you will need to create an interop wrapper for the 3D graph ActiveX control if you want to use the 3D graph in a Windows Forms project. However, data types like CNiReal64Vector are only in the C++ interfaces and are not in the ActiveX interface, hence you can use normal .NET data types and will not need to create the C++ data types. The interop wrapper will convert the .NET data types to the expected ActiveX data types and will pass those data types on to the ActiveX control. For example, here is a C# example that demonstrates how to plot a dual sine surface on the interop wrapper of the 3D graph:
    const int size = 40;
    double[] xData = new double[size];
    double[] yData = new double[size];
    double[,] z
    Data = new double[size, size];
    for (int i = 0; i < size; ++i)
    xData[i] = yData[i] = ((i - 20.0) / 20.0) * Math.PI;
    for (int i = 0; i < size; ++i)
    for (int j = 0; j < size; ++j)
    zData[j, i] = Math.Sin(xData[i]) * Math.Cos(yData[j]) + 2.0;
    graph3D.Plot3DSurface(xData, yData, zData, Type.Missing);
    - Elton

  • Insufficient permissions for performing this operation through Windows Form application.

    When accessing a report through the browser the user can view the report, however, have a report viewer in a Windows Form application get the below error when loading the report:
    See the end of this message for details on invoking
    just-in-time (JIT) debugging instead of this dialog box.
    ************** Exception Text **************
    System.Web.Services.Protocols.SoapException: The permissions granted to user
    'domain\username'
    are insufficient for performing this operation. ---> Microsoft.ReportingServices.Diagnostics.Utilities.AccessDeniedException: The permissions granted to user 'domain\username' are insufficient for performing this operation.
       at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
       at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
       at ReportServer.ReportService.ReportingService2010.GetReportServerConfigInfo(Boolean ScaleOut)
       at ReportServer.ReportItems.GetReportServerName()
       at Evolution2Application.FormMain.treeViewEvolutionReports_AfterSelect(Object sender, TreeViewEventArgs e)
       at System.Windows.Forms.TreeView.OnAfterSelect(TreeViewEventArgs e)
       at System.Windows.Forms.TreeView.TvnSelected(NMTREEVIEW* nmtv)
       at System.Windows.Forms.TreeView.WmNotify(Message& m)
       at System.Windows.Forms.TreeView.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    C# code I use to connect to the reporting service
    ReportingService2010
    rs =newReportingService2010();
    rs.Credentials
    =System.Net.CredentialCache.DefaultCredentials;
    rs.Url
    =http://sqlserver01/reportserver/reportservice2010.asmx;
    Can someone explain what I need to do to prevent getting this error, the user has ContentManager rights on the server through a security group.

    found the issue rs.GetConfigInfo(false) was causing the error, now removed this.

  • Problem  windows form modal in SAP BO

    Dear all.
    I have a problem.
    I developed an Add-on to show a windows form. The windwos form call the
    Cyristal Report's viewer. The form is call in a separeted Tread:
      Dim mySC As New Class1
                            designThread = New System.Threading.Thread(New System.Threading.ThreadStart(AddressOf mySC.Disegna))
                            designThread.Name = CR_REPORT_NAME_SCAD_COD_CLI
                            designThread.ApartmentState = System.Threading.ApartmentState.STA
                            designThread.Priority = Threading.ThreadPriority.Highest
                            designThread.Start()
    Now it happens that :
         the first time I run the form that's OK, but if i try to run it again      without stopping the application there is an error not clearly specified.
         Additionally the first time , when all seems Ok,
         the form is not bring to front
    (i used the property topmost=true and the method showdiagol).
    CAN YOU HELP ME??? THANKS

    Antonio,
    In the SAP Business One forum for the SDK, ie. this forum, in the forum "Search" on the main page, type in "crystal".  You will see many posts that may help assist with you question that you can read through.
    Hope this helps,
    Eddy

  • Problem in adding "TableLayoutPanel" control array type functionality on windows form dynamically using drag and drop

    Environment: -
     (Application Machine)
    OS Name             : -
    Microsoft Windows 7 Professional/XP SP2/SP3            
    OS Bit Version      : -
    32 Bit                     
    Application Name: - Designer.exe                                  
    IDE                  
        : - Visual Studio 2008                        
    EXE Application development: -
    VB. Net
    Application Type: -
    Application “Designer.exe” was designed in vb6.0 and now, it has been upgraded to Visual Studio 2008 and it works properly.
    Product Description: -
                 We have an application Designer.exe, which is used for designing “Forms”.
    It has menu option with following option like Panel, Text Box, Combo Box, Button etc. We drag any of this menu items and place it to form.
    Requirement: -
    We have
    critical requirement in product. In Designer.exe, we need to align form margin, while we increase or decrease window. And for that we have searched that 
     “TableLayoutPanel” components can be helpful.
    Problem description: -
    Earlier code was in vb6.0, now it has upgraded to Visual Studio 2008. In vb6.0, we have used control array for memory utilization with Combo Box, Group Box, and Text
    Box etc.
    But, for alignment we have to use “TableLayoutPanel”
    control array type functionality on form.
    Code Snippet: - For earlier designing component e.g. Frame
    'Required by the Windows Form Designer
    Public WithEvents Frame1 As Microsoft.VisualBasic.Compatibility.VB6.GroupBoxArray
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
    Me.components = New System.ComponentModel.Container
    Me.Frame1 = New Microsoft.VisualBasic.Compatibility.VB6.GroupBoxArray(Me.components)
    CType(Me.Frame1, System.ComponentModel.ISupportInitialize).BeginInit()
    . Kindly suggest approach for implementing requirement.
    Kindly help us to complete the requirement. I will be really
    thankful for any assistance.

    Hi S.P Singh,
    Welcome to MSDN.
    I am afraid that as Renee Culver said, these forums donot support VB6, you could refer to this thread:
    Where to post your VB 6 questions
    You could consider posting this issue in these forums below:
    These forums do not support Visual Basic 6, however there are many third-party support sites that do. If you have a VB6-related question please visit these popular forums:
    VB Forums
    VB City
    Thanks for your understanding.
    Best Regards,
    Youjun Tang
    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.

  • Problem with Cyrstal Report viewer in a Windows Form App Franework 4.0

    I appear to have a issue with Cyrstal Reports runt-time 13.0.2000.0 in a Windows 7 64 bit environment.
    Crystal Report Viewer is not displaying the report but instead is displaying the logon screen with the database name missing.
    1.) App is a .net windows form app using 4.0 framework compiled in the visual studio 2010.
    Compile machine has the development evironment for crystal report 13.0.2000.0 loaded. Compiled for any CPU.
    The Viewer is setup to access the report using oledb conection with sql server using SQL authentication.
    The Viewer works great for all enviroments except for windows 7 64 bit.

    Hello,
    Set your project for X64 only, and note for 32 bit OS then set it for x86. It's a MSIExec issue and not CR. If MSIExec detects a 64 bit OS but your app is using 32 bits then you'll run into distribution problems.
    If you are using MS SQL Server 2008 then you have to install the Client Tools and select the SQL Native 10 driver. MS doesn't support MDAC DB drivers to MS 2008. Search MS's site for more info.
    You also need to install the 64 bit Client Tools for this to work on a 64 bit OS's.
    If you are using SQL 2005 then you have to use the MS OLE DB Provider for SQL Server, Cr doesn't support the Native driver for 2005.
    I use this configuration all the time so it should work.
    Also, are you using SP 1? The GAC Assembly version always stay the same, it's the dll version we need to know.
    Don

  • Problems with the System.Windows.Forms.Timer

    Hi All,
    Could some one help me please? I'm having a problem using the System.Windows.Forms.Timer inside an ItemEvent, the timer event just doesn't works...give a look in my code:
    private System.Windows.Forms.Timer myTimer = new System.Windows.Forms.Timer();
    if (pVal.FormUID.Equals("FrmTimer") && pVal.ItemUID.Equals("btnStartTimer") && (pVal.Before_Action.Equals(true)) && (pVal.EventType.Equals(SAPbouiCOM.BoEventTypes.et_CLICK)))
                myTimer .Interval = 1000;
                myTimer .Enabled = true;
                myTimer .Tick += new EventHandler(myTimer _Tick);
    void myTimer _Tick(object sender, EventArgs e)
                SBO_Application.MessageBox("Timer: " + DateTime.Now, 1, "OK", "", "");
    does someone have already tried to use the timer inside an itemevent, or could suggest another solution?
    thanks a lot...

    Hi Bruno,
    Unfortunately you cannot use a Forms.Timer without using a windows form (ie not a SBO form). Have you looked at the other 2 timer objects in .Net, the System.Timer.Timer and System.Threading.Timer? Here's a link to a web page that goes through the differences between each one:
    http://msdn.microsoft.com/msdnmag/issues/04/02/TimersinNET/
    Kind Regards,
    Owen

  • Database Connection Problem via a Windows Form

    I am having a problem getting a database connection using a windows form. The strange thing is I can use the same connection string in the sister web application and the database connection works perfectly fine.
    I am using:
    .NET 1.1
    ODP.NET 9.2.0.700
    Oracle 9i PatchSet 11
    Here is an example of the connection string:
    _oraConnStringMain = "Data Source=mydb;User Id=myid;Password=mypass"
    The error is: "ORA-12154: TNS:could not resolve service name" and remember the same connection string and implementation is the web application works fine.
    Offending code:
              public bool ValidateOracleConnection(string connectionString)
                   bool _success = false;
                   OracleConnection oraConn = new OracleConnection(connectionString);
                   try
                        oraConn.Open();
                        _success = true;
                   catch (Exception ex)
                        MessageBox.Show(ex.Message.ToString(), "MYAPP", MessageBoxButtons.OK,
                             MessageBoxIcon.Information);
                        _success = false;
                   return _success;
    Any ideas?

    Hi Steven,
    My only WAG is that a different sqlnet.ora or tnsnames.ora might be used for the two different apps. Search your machine for both files. Are they only in the OH\network\admin directory?
    You may want to run a client side sqlnet trace of both apps, and compare them. It should tell you what tnsnames.ora file it's using, and may give a clue as to why the difference.
    Hope that helps,
    Greg

  • Problem with Windows Form called from SAP

    I have a simple VB.NET windows form that I'm calling from a new menu click event from within SAP.
    The form loads, as expected, when the menu item is clicked, but the form will always load outside of the SAP window and thus cannot be seen by the user unless they see it in their toolbar.
    Has anyone run into this in the past?  I would normally use the UI-API, but this is a form from another program that can't use the UI-API.
    I've also tested this with simple test forms with another test project and get the same results.
    Any ideas?
    Thanks!

    This isn't merely a matter of viewing <i>new</i> windows.
    When the SBO window is active and in full screen mode and one switches, using the task bar, to another application, more often than not the other application's window won't be displayed, or will be displayed but partially. One has to deactivate and re-activate the second window to see it correctly.
    It's the whole bloody SBO graphical engine that's bogus, if you ask me. Talk about reforging <i>that</i> to a profit-oriented company...
    @Marc Roussel:
    BTW, System.Windows.Forms.Form#ShowDialog() is a blocking method, AFAIK. So the following statements won't be executed ere the "dialog"'s closed.
    But this doesn't change the problem. The Activate() and BringToFront() don't help resolve the matter, in my experience. Sometimes the new form will appear on Z-top, sometimes it won't. Or maybe the true problem is that the window <i>is</i> on top, but doesn't get painted.
    ADDENDUM:
    Come to think of it, it might be worth a try to programmatically iconify/deiconify the new window. Something along the lines of:
    Dim f as Form = ...
    f.Show()
    Application.DoEvents()
    f.WindowState = FormWindowState.Minimized
    Application.DoEvents()
    f.WindowState = FormWindowState.Normal
    Application.DoEvents()
    (all in System.Windows.Forms Namespace)

  • Crystal Report Windows Forms Viewer problems - table could not be found

    Hi,
    I installed Crystal Report Viewer in SAP Business One 2007. All the while, I can run the reports without any problem. but when I loaded some of the new report, it gives me the following error message:
    the caption says: "Crystal Reports Windows Forms Viewer"
    the message says: "The table 'paymentVoucher' could not be found.
    Error in file C:\...paymentVoucher.rpt. The table could not be found."
    By the way, I can run the report in another workstation.
    Any help or ideas of why this is happening or how to solve this will be greatly appreciated.
    Thanks in advance.

    The report is not created by me. I just help others to transfer the report from one workstation to another workstation. PaymentVoucher is a view in the database and it is being put at a workstation that can be shared by everyone.
    I've go through other forums and found out that it might be permission issues and now managed to solve the problem already.
    Thanks everyone for the advice.

  • Strange Problem with windows form in SBO

    Hi all
    I encountered a strange problem
    I have a standard .net windows form that I am activating from a menu in SBO
    In the test Env. in our office the form always shows on top, whoever in the customer site first time you activate the menu the form appears correctly on top but when you close the form and press the menu again the form will appear "behind" the SBO.
    The form will appear on top only the first time you use it.
    The form is set to TopMost true
    I also tried using the user32.dll functions of SetFocus and SetForgroundWindow
    (I put them in the Activated event of the form)
    But it made no difference – first time form on top - the rest the from is behind
    The form is run on a separate thread and as I said works perfectly in the test Env.
    I am using .net 2005 with SBO 2005
    Any Ideas ?
    Thanks
    Ronny

    Hi Roni,
    I think you will find the answer to your question in this thread.
    https://forums.sdn.sap.com/click.jspa?searchID=3636651&messageID=844077
    Regards,
    Felipe

  • Windows Form with SAP B1 Problem

    Dear all,
    I'm building an add-on that use some windows form.
    In Menu Event i placed the code for open my windows form:
                        MyForm xxx = new MyForm();
                        xxx.WindowState = System.Windows.Forms.FormWindowState.Normal;
                        xxx.Visible = true;
                        xxx.ShowInTaskbar = true;
                        xxx.TopMost = true;
                        xxx.Text = string.Empty;
                        xxx.ControlBox = false;
                        System.Windows.Forms.Application.Run(xxx);
    All works fine, but, when my form is open i can't operate on SAP.
    It's like my form is modal, and until I have it open I can't do anything outside the form.
    Can someone help me?
    Regards
    Diego

    Hi Diego
    There's actually two ways to build an add-on, one that runs inside SAP Business One and one that runs along SB1 side but built on windows forms.  You can see this clearly if you try some of the add-on samples that come along with B1.  Overall, when I did the analysis I ended up with the conclusion that I was going to spend twice the work to achieve windows forms.
    First, you would have develop classes and objects that keep in communication with Business One.  Second, you have to keep in mind that you cannot create, update, or delete data directly to the database unless you use the SDK provided objects and methods.  Which brings you back to the SAP data sources.
    Furthermore, you can run into a bit of complexity do to the fact that to illustrate data in your form, you might have to "convert" your data.  For instance, say a SAP recordset into a dataset or ADO recordset.  In other words, you can end up with a bit more complex architecture the way I see it.
    Using the Screen Painter and SAP Business One tools such as the BIDE you can construct bound form (UDOs) which can even require very little coding from your part (if forms are not to be too complex).  Once you get use to SAP's way handling data objects you see is a lot easier than trying the alternative.

  • How to implement two way databinding in windows form c#

    suppose my win form has textboxes, listbox, dropdown, radio button and check box. now i want to bind those control and whenever data will be changes from out side then change should be reflected in control level. how to achieve it in winform. help me with
    a small working sample code. thanks

    Hello,
    If using SQL-Server look at using SQL Dependency class to get notified of changes outside of your application say by another app or from even SQL Server Management Studio
    https://www.google.com/search?q=sqldependency+example&sourceid=ie7&rls=com.microsoft:en-US:IE-SearchBox&ie=&oe=&rlz=&safe=active&gws_rd=ssl
    Sorry I don't have a working example but perhaps the following might provide a clue into what is needed. I am only using a DataGridView but this could be expanded to other controls. There is a good deal of preparation and work internally to have this working
    right when considering all scenarios
    Form code
    namespace FrontEnd_CS
    /// <summary>
    /// Provides the basics to listen to a database table operations, see also the
    /// Readme file in the Solution Items
    /// </summary>
    /// <remarks>
    /// DgvFilterManager is a third party component that permits right-click a column header
    /// in a DataGridView and do filtering on one or more columns
    /// </remarks>
    public partial class Form1 : Form
    private BindingSource bs = new BindingSource();
    private Customers CustomerData = null;
    public Form1()
    InitializeComponent();
    try
    SqlClientPermission perm = new SqlClientPermission(System.Security.Permissions.PermissionState.Unrestricted);
    perm.Demand();
    catch
    throw new ApplicationException("No permission");
    public void OnNewMessageFromServer()
    ISynchronizeInvoke iSyncInvoke = (ISynchronizeInvoke)this;
    // Check if the event was generated from another thread and needs invoke instead
    if (iSyncInvoke.InvokeRequired)
    Customers.NewMessage messageDelegate = new Customers.NewMessage(OnNewMessageFromServer);
    iSyncInvoke.BeginInvoke(messageDelegate, null);
    return;
    // If not coming from a seperate thread we can access the Windows form controls
    LoadCurrentData();
    private void LoadCurrentData()
    DataGridView1.DataSource = null;
    bs.DataSource = CustomerData.GetMessages();
    DataGridView1.DataSource = bs;
    DataGridView1.ExpandColumns();
    bindingNavigator1.BindingSource = bs;
    private void Form1_Load(object sender, EventArgs e)
    CustomerData = new Customers();
    CustomerData.OnNewMessage += OnNewMessageFromServer;
    LoadCurrentData();
    Support code
    namespace BackEnd_CS
    public class Customers
    private static string ConnectionString = "Server=.\\SQLEXPRESS;Trusted_Connection=True;Initial Catalog=CustomerDatabase";
    private SqlConnection Connection = null;
    public delegate void NewMessage();
    public event NewMessage OnNewMessage;
    public Customers()
    // Stop an existing services on this connection string just be sure
    SqlDependency.Stop(ConnectionString);
    // Start the dependency, User must have -- SUBSCRIBE QUERY NOTIFICATIONS permission
    // Database must also have SSB enabled -- ALTER DATABASE CustomerDatabase SET ENABLE_BROKER
    SqlDependency.Start(ConnectionString);
    // Create the connection
    Connection = new SqlConnection(ConnectionString);
    ~Customers()
    SqlDependency.Stop(ConnectionString);
    /// <summary>
    /// Retreive messages from database via conventional SQL statement
    /// </summary>
    /// <returns></returns>
    /// <remarks></remarks>
    public DataTable GetMessages()
    DataTable dt = new DataTable();
    try
    // Create command
    // Command must use two part names for tables
    // SELECT <field> FROM dbo.Table rather than
    // SELECT <field> FROM Table
    // Do not use
    // FROM [CustomerDatabase].[dbo].[Customer]
    // Use
    // FROM [dbo].[Customer]
    // Query also can not use *, fields must be designated
    SqlCommand cmd = new SqlCommand("SELECT [Identifier],[CompanyName],[ContactName],[ContactTitle] FROM [dbo].[Customer]", Connection);
    // Clear any existing notifications
    cmd.Notification = null;
    // Create the dependency for this command
    SqlDependency dependency = new SqlDependency(cmd);
    // Add the event handler
    dependency.OnChange += OnChange;
    // Open the connection if necessary
    if (Connection.State == ConnectionState.Closed)
    Connection.Open();
    // Get the messages
    dt.Load(cmd.ExecuteReader(CommandBehavior.CloseConnection));
    catch (Exception ex)
    throw ex;
    return dt;
    /// <summary>
    /// Handler for the SqlDependency OnChange event
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    private void OnChange(object sender, SqlNotificationEventArgs e)
    SqlDependency dependency = sender as SqlDependency;
    // Notices are only a one shot deal so remove the existing one so a new one can be added
    dependency.OnChange -= OnChange;
    // Fire the event
    if (OnNewMessage != null)
    OnNewMessage();
    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my webpage under my profile but do not reply to forum questions.

  • 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.

  • I Need Help Trying to Play (.pls) files in a simple windows forms Application

     So I'm try to build application that when I click on the icon it opens a little window and play the url .pls. I already got the graphics of the app i just to get the code and I've been looking around for but all i got was this code
    typedef struct
    int count;
    void **name;
    void **displayname;
    } Playlist;
    Playlist* my_playlist; // SHOUTCAST PLAYLIST
    #define BOX(text) MessageBox(NULL,text,"Info",MB_OK | MB_TOPMOST);
    char *stristr(char *string2, char *string1) // from /samples/fmod/Main.c
    char *s1 = strdup(string1);
    char *s2 = strdup(string2);
    char *ret = 0;
    int i, j;
    int len1 = (int)strlen(string1);
    int len2 = (int)strlen(string2);
    for (i=0;s1[i];i++) s1[i] = tolower(s1[i]);
    for (i=0;s2[i];i++) s2[i] = tolower(s2[i]);
    for (j=0;j < (len2 - len1);j++)
    char *a = s1;
    char *b = &s2[j];
    for (i=0;(i < len1) && *a && *b;a++, b++, i++)
    if (*a != *b)
    break;
    if (i == len1)
    ret = &string2[j];
    break;
    free(s1);
    free(s2);
    return ret;
    Playlist *ParsePlaylist(char *name) // from /samples/fmod/Main.c and MSDN
    char *filebuf, *p;
    Playlist *playlist = 0;
    int count, i;
    // Check if URL is null
    if (!name)
    BOX("Streaming URL is empty");
    return 0;
    // Check if URL is a *.pls file
    if (_stricmp((const char *)".pls", (const char *)(&name[strlen(name) - 4])))
    return 0;
    // Create a WinInet session
    HINTERNET hSession = InternetOpen(_T(""), INTERNET_OPEN_TYPE_PRECONFIG, 0, 0, 0);
    // Prepare a request
    HINTERNET hRequest = InternetOpenUrl(hSession, name, 0, 0, 0, 0);
    // Send the HTTP request.
    HttpSendRequest(hRequest, 0, 0, 0, 0);
    // Read the response data.
    DWORD dwNumberOfBytesAvailable = 0;
    do
    // Retrieve size of remote file
    InternetQueryDataAvailable(hRequest, &dwNumberOfBytesAvailable, 0, 0);
    if (0 < dwNumberOfBytesAvailable)
    // Allocate buffer memory
    filebuf = new char[dwNumberOfBytesAvailable + 1];
    filebuf[dwNumberOfBytesAvailable] = 0;
    DWORD dwBytesRead = 0;
    // Read remote file and put in buffer
    InternetReadFile(hRequest,
    filebuf,
    dwNumberOfBytesAvailable,
    &dwBytesRead);
    //BOX(filebuf);
    while (0 < dwNumberOfBytesAvailable);
    // Close the request handle.
    InternetCloseHandle(hRequest);
    // Close the WinInet session.
    InternetCloseHandle(hSession);
    // Parse the pls file (from Fmod sample)
    p = stristr(filebuf, "NumberOfEntries=");
    if (!p)
    BOX("Streaming : NumberOfEntries in pls file not found");
    return 0;
    p += 16;
    count = atoi(p);
    if (!count)
    BOX("Streaming : numeric value for NumberOfEntries not found");
    return 0;
    playlist = (Playlist *)calloc(sizeof(Playlist), 1);
    if (!playlist)
    BOX("Streaming : can't allocate memory for pls file (playlist)");
    return 0;
    playlist->count = count;
    playlist->name = (void **)calloc(sizeof(char *) * count, 1);
    if (!playlist->name)
    BOX("Streaming : can't allocate memory for pls file (playlist->name)");
    return 0;
    playlist->displayname = (void **)calloc(sizeof(char *) * count, 1);
    if (!playlist->displayname)
    BOX("Streaming : can't allocate memory for pls file (playlist->displayname)");
    return 0;
    for (i=0;i < count;i++)
    char tmp[32];
    char *filename, *displayname, *t;
    filename = displayname = 0;
    sprintf(tmp, "File%d=", i + 1);
    p = strstr(filebuf, tmp);
    if (p)
    p += strlen(tmp);
    t = p;
    for (;*t && (*t != 0xa) && (*t != 0xd);t++);
    if (*t)
    char tmpc = *t;
    *t = 0;
    filename = _strdup(p);
    *t = tmpc;
    if (strncmp(filename, "http://", 7) && strncmp(filename, "http:\\\\", 7))
    char *tmpname = _strdup(filename);
    p = &tmpname[strlen(tmpname) - 1];
    for (;(p > tmpname) && (*p != '\\') && (*p != '/');p--);
    if ((*p == '\\') || (*p == '/'))
    p++;
    displayname = _strdup(p);
    free(tmpname);
    playlist->name[i] = filename;
    playlist->displayname[i] = displayname;
    free(filebuf);
    return playlist;
    [main code]
    char string_music[256] = "http://www.shoutcast.com/sbin/shoutcast-playlist.pls?rn=6042&file=filename.pls"; // For example
    // Parse the remote file (in case it's a Shoutcast playlist (*.pls))
    my_playlist = ParsePlaylist(string_music);
    if (my_playlist)
    strcpy(string_music, (char*) my_playlist->name[0]); // for the first song in the playlist
    FSOUND_STREAM * my_stream = FSOUND_Stream_Open(string_music, FSOUND_NORMAL | FSOUND_NONBLOCKING, 0, 0);
    int int_sound_mp3 = FSOUND_Stream_Play(FSOUND_FREE, my_stream);
    and i got to link it to Wininet.lib
    and I'm a noob so i got problems as soon as i tried to put everything together
    so any help greatly appreciated 
    BTW if you know any other ways, that I'll be able to stream the audio that will be great to.
    heres the link for the audio stream (.pls)
    http://panel3.serverhostingcenter.com:2199/tunein/nrlsxglp.pls

    Hello 0cooldex0,
    What library do you used in this scenario? I haven't saw this FSOUND_STREAM from MSDN library.
    By the way, winform general is used for talking about Windows Form library, is is using C# or VB.NET but not C or C++. You are not posting in the right forum.
    In my point of view, you may choose the forum depending on the library you choosed and post on specific forum.
    Regards,
    Barry
    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.

Maybe you are looking for

  • Questions in adapters??

    please answer the following questions 1) In BPM Async-Sync bridge, does the QOS change?? 2) What is logging / trace? List 4 ways to enable logging / trace? 3) What are the 4 functions does adapter framework provide? 4) If communications with JDBC usi

  • [SOLVED] Recovery shell Problem / Arch novice booting 1st time

    This is my problem after/during the boot of the Arch for the first time: Root device `/dev/hda3`doesn`t exist, attempting to create it ERROR: Failed to parse block device ids for `/dev/hda3` ERROR: Unable to detect or create root device `/dev/hda3` Y

  • MATERIALIZED VIEW and MATERIALIZED VIEW LOG

    Hello, I have the following table create table My_price (price_id number(10), product_id number(10), price_date date, price_value number(10,2)); I want to create the following materialized view create materialized view Last_Price_Date refresh on comm

  • Dreamweaver CS3 and Athlon 64

    I just installed Creative Suite 3 Web Premium on my computer. When I run Dreamweaver CS3, PerfMon shows the processor spiking to between 80-100% every few seconds. Avg. pages/sec and disk queue length don't seem to be affected. This happen when I'm a

  • User profile doesn't stop execution due to it's restriction

    Oracle Version: SQL> select * from v$version; BANNER Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi PL/SQL Release 10.2.0.4.0 - Production CORE    10.2.0.4.0      Production TNS for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Pro