Home All Groups Group Topic Archive Search About
Author
25 Jan 2006 1:49 PM
Ilya Dyoshin
Hi all

There is an XML file, formed from dataset.

I want to see this in the RTF-document like a set of tables.
something like:

Table1 name
+------------------------+------------------------+--------------------+
| Table1.Column1 name    | Table1.Column 2 name   | Table1.Column3 name|
+------------------------+------------------------+--------------------+
|Column1.Row1 data       | column2.row1 data      | column3.Row1 data  |
+------------------------+------------------------+--------------------+
|Column1.Row2 data       | column2.row2 data      | column3.Row2 data  |
+------------------------+------------------------+--------------------+

Table2 name
+------------------------+------------------------+
| Table2.Column1 name    | Table2.Column 2 name   |
+------------------------+------------------------+
|Column1.Row1 data       | column2.row1 data      |
+------------------------+------------------------+
|Column1.Row2 data       | column2.row2 data      |
+------------------------+------------------------+

and so on.


Can someone give me code samples how to do it?

Thanks all!

Author
25 Jan 2006 2:15 PM
Miha Markic [MVP C#]
Hi Ilya,

You might consider using XSLT to generate RTF.
Sorry, no samples...

--
Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

Show quote
"Ilya Dyoshin" <zip***@mail.ru> wrote in message
news:dr800c$1a09$1@news.univ.kiev.ua...
> Hi all
>
> There is an XML file, formed from dataset.
>
> I want to see this in the RTF-document like a set of tables.
> something like:
>
> Table1 name
> +------------------------+------------------------+--------------------+
> | Table1.Column1 name    | Table1.Column 2 name   | Table1.Column3 name|
> +------------------------+------------------------+--------------------+
> |Column1.Row1 data       | column2.row1 data      | column3.Row1 data  |
> +------------------------+------------------------+--------------------+
> |Column1.Row2 data       | column2.row2 data      | column3.Row2 data  |
> +------------------------+------------------------+--------------------+
>
> Table2 name
> +------------------------+------------------------+
> | Table2.Column1 name    | Table2.Column 2 name   |
> +------------------------+------------------------+
> |Column1.Row1 data       | column2.row1 data      |
> +------------------------+------------------------+
> |Column1.Row2 data       | column2.row2 data      |
> +------------------------+------------------------+
>
> and so on.
>
>
> Can someone give me code samples how to do it?
>
> Thanks all!
Author
28 Jan 2006 5:48 AM
W.G. Ryan eMVP
Show quote
"Ilya Dyoshin" <zip***@mail.ru> wrote in message
news:dr800c$1a09$1@news.univ.kiev.ua...
> Hi all
>
> There is an XML file, formed from dataset.
>
> I want to see this in the RTF-document like a set of tables.
> something like:
>
> Table1 name
> +------------------------+------------------------+--------------------+
> | Table1.Column1 name    | Table1.Column 2 name   | Table1.Column3 name|
> +------------------------+------------------------+--------------------+
> |Column1.Row1 data       | column2.row1 data      | column3.Row1 data  |
> +------------------------+------------------------+--------------------+
> |Column1.Row2 data       | column2.row2 data      | column3.Row2 data  |
> +------------------------+------------------------+--------------------+
>
> Table2 name
> +------------------------+------------------------+
> | Table2.Column1 name    | Table2.Column 2 name   |
> +------------------------+------------------------+
> |Column1.Row1 data       | column2.row1 data      |
> +------------------------+------------------------+
> |Column1.Row2 data       | column2.row2 data      |
> +------------------------+------------------------+
>
> and so on.
>
>
> Can someone give me code samples how to do it?
>
> Thanks all!
--Ilya - like Miha mentions, you would probably want to use XSLT b/c it will
support this translation.  XSLT is  one of those skills IMHO that has a
little bit of a learning curve up front (like Regular Expressions)  but it
pays for itself in droves in the future. Suffice to say that you can parse
stuff a zillion ways, you can take those parsed tokens and use a RTF writer
class to write the RTF, you can do a lot of things. But if you take a few
steps back and focus on XSLT, you'll have a clean elegant solution + you'll
have a skill that you Will be glad you picked up , in the near future  This
should help get you started:

http://www.experts-exchange.com/Programming/Programming_Languages/C_Sharp/Q_21346463.html

AddThis Social Bookmark Button