Silverlight / WPF - Help in XPS?

Asked By Kannabiran .
18-Oct-08 12:44 AM

Hi everyone,
    i am trying to export listview data to xps using c#.net3.5, wpf. is it possible to export to xps? if it is possible means give me some samples.

regards
Kanna

Hope this will help:  Hope this will help:

18-Oct-08 12:58 AM
Public Function AddRowToTable(ByRef dt As DataTable, _
      
ByVal ParamArray DRows() As Object) As Boolean
      Dim i As Short
      Try
         Dim newRow As DataRow = dt.NewRow
        
For i = 0 To UBound(DRows)
            
' add a row to the passed dtList
            newRow(i) = DRows(i)
        
Next
         dt.Rows.Add(newRow)
        
Return True
      Catch ex As System.Exception
         MsgBox(ex.ToString)
        
Return False
      End Try
   End Function

Public Sub ReloadListviewFromXML()
      
Dim ds As New DataSet

      
Try
         ds.ReadXml(Me.textOpenPath.Text)
        
Dim dt As DataTable = ds.Tables("PrintObject")
        
Dim i As Integer
         Dim j As Integer
         Me.listviewObjects.Items.Clear()

        
For i = 0 To dt.Rows.Count - 1
            
Dim dr As DataRow = dt.Rows(i)
            
With Me.listviewObjects
               .Items.Add(dr(0))
              
For j = 1 To dt.Columns.Count - 1
                  .Items(i).SubItems.Add(dr(j))
              
Next
            End With
         Next
      Catch ex As System.Exception
         StructuredErrorHandler(ex)
      
End Try
   End Sub

Go through this link:
http://www.knowdotnet.com/articles/serializationoflistviewtoxml.html

Hep in xps?  Hep in xps?

18-Oct-08 01:08 AM

Hi Binny,

     I have little bit confusion.actually im trying to export to XPS not to xml.i know that xps is xml paper specification.but couldnt understand.can u explain little bit clear?

 

rgrds

Kanna..

solution  solution

18-Oct-08 01:12 AM
AFAIK, there is no direct way to export data to XPs. You can use Infragistice NetAdvantage for .NET + WPf for this. It will allow your to enable this for you. See http://www.componentsource.com/products/infragistics-netadvantage-net-wpf/index.html for details.

Regards,
Megha

help in xps?  help in xps?
18-Oct-08 01:22 AM

Hi Megha,

    Thnx for ur time..is it possible to achieve only by using third party tool? or can we done through programmatically in .net code.

rgrds

kanna

solution  solution
18-Oct-08 02:01 AM
In VB it is possible using System.Windows.Xps.Packaging  namespace, you will need to do following

Dim xpsDoc As New XpsDocument(outputName, IO.FileAccess.Read)
DocumentViewer1.Document = xpsDoc.GetFixedDocumentSequence

OutputName is nothing but from where you want to read data and store in XPS format.

See http://www.codeproject.com/KB/docview/GenerateXPSfromWordVB.aspx and http://www.microsoft.com/whdc/xps/default.mspx for details.

Regards,
Megha
try this code  try this code
18-Oct-08 07:58 AM
Code Snippet

Microsoft.Office.Interop.Excel.Application xla = new Microsoft.Office.Interop.Excel.Application();

xla.Visible = true;

Microsoft.Office.Interop.Excel.Workbook wb = xla.Workbooks.Add(Microsoft.Office.Interop.Excel.XlSheetType.xlWorksheet);

Microsoft.Office.Interop.Excel.Worksheet ws = (Microsoft.Office.Interop.Excel.Worksheet)xla.ActiveSheet;

int i = 1;

int j = 1;

foreach (ListViewItem comp in listView1.Items)

{

ws.Cells[i, j] = comp.Text.ToString();

//MessageBox.Show(comp.Text.ToString());

foreach (ListViewItem.ListViewSubItem drv in comp.SubItems)

{

ws.Cells[i, j] = drv.Text.ToString();

j++;

}

j = 1;

i++;

}

 

Create New Account
help
Framework " / > Hallo, ich will alle selektierten Eintr?ge in einem ListView in eine Liste ?bernehmen. ListViewItem listViewItem; listViewItem = new ListViewItem(); listViewItem.Text = "Eintrag 1"; listView1.Items.Add(listViewItem); listViewItem = new ListViewItem(); listViewItem.Text = "Eintrag 2"; listView1.Items.Add(listViewItem); List<ListViewItem> listItem = new List<ListViewItem> (); listItem
SilverLight What is SilverLight, its concept, why to use it and how to use it What is Silverlight? Silverlight is a new cross-browser, cross-platform implementation of the .NET Framework for building and browsers, including Microsoft Internet Explorer, Mozilla Firefox, Apple Safari, Opera. The plugin required to run Silverlight is very small in size hence gets installed very quickly. It is combination of different platform that allows you to select tools and the programming language you want to use. Silverlight integrates seamlessly with your existing Javascript and ASP.NET AJAX code to complement functionality which you have already created. Silverlight aims to compete with Adobe Flash and the presentation components of Ajax . It also competes with Sun Microsystems' JavaFX, which was launched a few days after Silverlight. Currently there are 2 versions of Silverlight: Silverlight 1.0 : Silverlight 1.0 consists of
silverlight and wpf difference if one person has gain master in silverlight than wiil this help him in learning wpf Hi Malik, WPF has a more advanced and mature XAML support than Silverlight. Silverlight used to be called (WPF / E) and is a subset of the WPF XAML design well and other items. WPF is hardware accelerated and supports things like GPU shaders which Silverlight 2 does not. Silverlight 2 does have the VisualStateManager inside Blend 2, which I think WPF needs an add on and a tweak to work. I think that is the only case where Silverlight 2 XAML was / is slightly ahead of WPF's. Here is a link on XAML us / library / cc917841(VS.95).aspx Here is a good article on MSNMAG about designing Silverlight / WPF apps together and sharing code: http: / / msdn.microsoft.com / en-us / magazine / cc895632.aspx
View HTML files in silverlight Silverlight / WPF hi. . how to View HTML files in silverlight? via silverlight how to disable the right click option in html files? i.e)SL html viewer no, status = no, menubar = no, resizable = yes"); } } } Create New Account keywords: View, HTML, files, in, silverlight description: p style = border:0px;margin-bottom: 18px; border-image: initial; outline-width: 0px; outline
Silverlight What is the purpose of Silverlight? Why it is used? How can I use silverlight in my application? Any simple web example of silverlight with VS 2005 and .Net Framework 2.0 (not the Hellow world Application). ? I want to start with Silverlight and I am very new to Silverlight. What is Silverlight? Microsoft Silverlight is a web browser plugin that provides support for rich internet applications such as animation