Tuesday May 15, 2012 at 02:25 PM | Posted by: chadc | Category: ASP.NET MVC | ASP.NET | C# | PDF | Reporting | Reporting / Back Office | WPF | Windows Forms | Doc

Ever need to convert multiple Word documents into one Pdf document?  Here is a quick and easy sample showing just that!

            // Creating a New document.
            WordDocument doc = New WordDocument();
            // Imports the first template document
            If ((String)textBox1.Tag != String.Empty)
                doc.ImportContent(New WordDocument((String)textBox1.Tag));
            Else
                MessageBox.Show("Browse a Word document To import", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            // Imports the second template document
            If ((String)textBox2.Tag != String.Empty)
                doc.ImportContent(New WordDocument((String)textBox2.Tag));
            Else
                MessageBox.Show("Browse a Word document To import", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);

            If ((String)textBox1.Tag != String.Empty && (String)textBox2.Tag != String.Empty)
            {
                DocToPDFConverter converter = New DocToPDFConverter();
                //Convert Imported word document into PDF document
                PdfDocument pdfDoc = converter.ConvertToPDF(doc);
                //Save the pdf file
                pdfDoc.Save((String)textBox1.Text + ".pdf");
                pdfDoc.Close(True);
            }

Sample Link

Multiple docs, doc to pdf

Tuesday Apr 10, 2012 at 02:09 AM | Posted by: davisj | Category: Windows Forms | Grid | Performance

The Syncfusion Windows Forms GridControl is a high performance Grid that is capable of loading data in virtual. In this sample, the Grid pages in data from a SQL Server database when scrolled.

Download sample: WF_GCPagingVirtualDB.zip

private void gridControl1_QueryCellInfo(object sender, Syncfusion.Windows.Forms.Grid.GridQueryCellInfoEventArgs e)
        {
            if (e.RowIndex == 0 && e.ColIndex > 0)
            {
                e.Style.Text = retriever.Columns[e.ColIndex - 1].ColumnName;
            }
            else if (e.RowIndex > 0 && e.ColIndex > 0)
            {
                if (this.myData == null || this.myData.RowCount == 0)
                    return;
 
                if (this.myData.EnsureDataAvailable(e.RowIndex))
                {
                    int rowPos = e.RowIndex - this.gridControl1.Rows.HeaderCount - this.myData.StartRow - 1;
                    if (rowPos >= this.myData.ActiveTable.Rows.Count)
                        return;
                    int colPos = e.ColIndex - this.gridControl1.Cols.HeaderCount - 1;
                    e.Style.CellValue = this.myData.ActiveTable.Rows[rowPos][colPos];
                    e.Style.BackColor = this.myData.ActiveTableColor;
                }
            }
        }

image

Wednesday Jul 27, 2011 at 08:18 PM | Posted by: clayb | Category: ASP.NET | Windows Forms | WPF

Syncfusion’s Windows Forms FAQ played a significant role in introducing Syncfusion to the .NET community. Both Syncfusion and .NET were new in 2001 and 2002 as Syncfusion was building its first products. Early on, it was decided that one way to publicize the Syncfusion brand was to produce a FAQ that would serve as a resource for the .NET community. FAQs for earlier technologies, such as MFC, had served to bring people to websites and generally reflected positively on the company that sponsored such efforts.

Syncfusion was working exclusively with Windows Forms at the time, so doing a Windows Forms FAQ was a no-brainer. The Syncfusion technical team worked on a core of a couple of hundred entries to provide the critical mass for the FAQ. The source of these entries was the knowledge our team had gained as we developed our Grid and Tools suites.

After the initial push to go live, it quickly became obvious that the online forums and newsgroups were an endless source of new questions and information that we could include in our FAQ. So, I got into a pattern of checking various newsgroups many times a day. As new questions were posted, I quickly decided whether a question would lead to a FAQ entry or not. If so, there was a rush to find a solution, prepare a FAQ, and then get it published to our website before anyone else could respond to the new question on the message board. We actually had an infrastructure available to complete the whole process in only a few minutes.

It became a game for us to see how fast we could go from seeing a question in a forum to posting a “FAQ” solution to the forum thread. We tweaked our FAQ writing and FAQ publishing infrastructure to facilitate responding to forum questions with scripted text referencing FAQ entries. The major piece of the required time was actually solving the issue and verifying it. Once that was done, we could produce and publish a FAQ entry with code snippets and samples to our website in less than two minutes. In some cases, less than 10 minutes after a question was posted on a newsgroup, a response was added to the thread saying you could find a solution in the Syncfusion Windows Forms FAQ .

We have both anecdotal evidence and real evidence that our Windows Forms FAQ was successful beyond our expectations. Because of its success, Syncfusion has since published additional FAQs on ASP.NET and WPF. The Windows Forms FAQ certainly provided major traffic to our website in the early years. Last year, I was having dinner with a group of people from a large Indian consulting firm. One of the senior consultants for the company had this to say: “When I hear Syncfusion, I think of your datagrid FAQ. Whenever I wanted to know how to do something with a datagrid, I found it there. I owe my career to that FAQ.”

Friday May 20, 2011 at 01:16 AM | Posted by: chadc | Category: ASP.NET | ASP.NET MVC | Silverlight | WPF | Windows Forms

We are very excited about our latest release, 9.2. In it, we have broken the ice and started developing to the HTML5 standard, we have created a map control and we are offering enhanced support for loading Excel files into our WPF and Silverlight grids. You can now create applications in Silverlight that have an Excel look and feel. This video focuses on just the User Interface portion of our suite.

  • HTML 5 Diagram for MVC
  • Maps for WPF and Silverlight
  • Excel import for WPF and Silverlight Grid
  • Ribbon control for ASP.NET
  • Hierarchy support in MVC grid
  • Spell checker for all platforms
  • Cardview for WPF
  • Sparkline charts for WinForms

Monday May 16, 2011 at 04:27 PM | Posted by: | Category: Reporting / Back Office | ASP.NET | Silverlight | WPF | Windows Forms

When it comes to producing Excel reports, the process has been more difficult than it ought to be, and the traditional alternatives for creating such reports have been weak. The old-school solutions such as using comma-separated values (CSV) format files or packages like Crystal Reports were the root cause of more than a few migraine headaches.

"The Excel file format is very complex," says Daniel Jebaraj, the vice president at Syncfusion who leads product development. "The amount of code is pretty stunning. Complicating matters further, there are multiple versions of Excel to deal with. Applications that resort to CSV files, for instance, do not account for formatting, formulas, charts, data filters, and so forth. As a result, the overall user experience is poor. Applications such as Crystal Reports that use WYSIWYG designing focus on producing reports in multiple formats (least common denominator approach), making charts, pivot tables, and sparklines difficult if not impossible to produce."

The good news for those faced with creating such reports is that Syncfusion has a high-fidelity Excel reporting solution called XlsIO that makes producing stunning Excel reports from .NET applications the easy and simple task that it should be. "Our solution is different because it offers the full power of the Excel platform and produces a report that the user is comfortable with, without having to do extra work," says Jebaraj.

Syncfusion's XlsIO is a .NET library that can read, write, and modify Microsoft Excel files. It features a full-fledged object model similar to the Microsoft Office Automation libraries. It can be used on systems that do not have Microsoft Excel installed, making it an excellent report engine. The solution enables users to create richly formatted Microsoft Excel reports in Windows Forms, ASP.NET, WPF, ASP.NET MVC, and Silverlight applications. Further, XlsIO lets you add Microsoft Excel reporting capabilities to your .NET applications within minutes.

"People can use the already familiar Microsoft Excel application to visually design their report," says Jebaraj. "XlsIO can then be used to populate the template with real data during run time and save the final report to a file on disk, stream, or even stream to the client browser."

Anton Yakushin, a systems analyst at Eastern Research Group (Boston, Mass.) had this to say about his experience using XlsIO: "This is by far the best component for dynamic Excel spreadsheet generation on the market. Our company has tried several alternatives, but nothing compares to the ease of use and performance of XlsIO. For programmers, [its] usability is similar to using the Office11-Office14 references in VB and C#.NET programming, except Syncfusion has found a way to make it even more intuitive and faster to work with. In fact, some functionalities are easier to do with Syncfusion's XlsIO than VBA in Excel, and the fact that they support all formats, 2000 [through] 2010, is extremely helpful to our clients. The XlsIO code is ready-to-go for generating virtually any file and sending it right into the response stream!"

Jebaraj concludes, "The two popular solutions, CSV and WYSIWYG, have tremendous deficiencies. Our solutiontakes the production of these files to a new level. Users want Excel files that are very rich, complete, and can be used in the way they see fit. This library delivers that for them."

Tag cloud