惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Troy Hunt's Blog
Google DeepMind News
Google DeepMind News
G
Google Developers Blog
F
Full Disclosure
N
Netflix TechBlog - Medium
C
Check Point Blog
Recent Announcements
Recent Announcements
MyScale Blog
MyScale Blog
The Register - Security
The Register - Security
MongoDB | Blog
MongoDB | Blog
Blog — PlanetScale
Blog — PlanetScale
M
MIT News - Artificial intelligence
H
Help Net Security
F
Fortinet All Blogs
P
Proofpoint News Feed
I
InfoQ
Stack Overflow Blog
Stack Overflow Blog
L
LangChain Blog
Engineering at Meta
Engineering at Meta
Recorded Future
Recorded Future
Vercel News
Vercel News
A
About on SuperTechFans
GbyAI
GbyAI
T
The Blog of Author Tim Ferriss
B
Blog RSS Feed
S
Securelist
Y
Y Combinator Blog
C
Cybersecurity and Infrastructure Security Agency CISA
D
DataBreaches.Net
B
Blog
The Hacker News
The Hacker News
Security Latest
Security Latest
P
Privacy & Cybersecurity Law Blog
Scott Helme
Scott Helme
D
Darknet – Hacking Tools, Hacker News & Cyber Security
V
Vulnerabilities – Threatpost
Martin Fowler
Martin Fowler
人人都是产品经理
人人都是产品经理
Forbes - Security
Forbes - Security
T
The Exploit Database - CXSecurity.com
Latest news
Latest news
月光博客
月光博客
aimingoo的专栏
aimingoo的专栏
Apple Machine Learning Research
Apple Machine Learning Research
J
Java Code Geeks
AWS News Blog
AWS News Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
H
Heimdal Security Blog
C
Cisco Blogs

博客园 - 代码乱了

MIT 18.06 线性代数 - 23微分方程,exp(At) MIT 18.06 线性代数 - 22. 对角化和矩阵的幂 测试markdown发布 visual webgui theme designer 健身视频 2012元旦遭遇坑爹的12306订票网站付了款不出票 博文阅读密码验证 - 博客园 ReportViewer 2008 打印出现Error loading resource library. (0x8007007E)和(0x80070006) 博文阅读密码验证 - 博客园 VM.xPort.ExcelClient XXX备忘 Parsing html markup text using MSHTML Winform Field interface 转换前台javascript传递过来的时间字符串到.net的DateTime 博文阅读密码验证 - 博客园 SQL:获取正在执行的SQL语句 博文阅读密码验证 - 博客园 VSX vsct file context menu for script editor - 代码乱了 利用XML转换为table实现在SQL参数中传递表结构 MSChart出现为ChartImg.axd 执行子请求时出错 - 代码乱了 - 博客园
Serialize and Deserialize RDL
代码乱了 · 2011-03-23 · via 博客园 - 代码乱了

If you have a ReportViewer class generated from the XSD report definition file using:
xsd.exe /c /namespace:Rdl ReportDefinition.xsd

You can serialize and deserialize the class to/from RDLC XML:

xmldoc contains the XML RDLC code and is an XmlDocument.

Deserialization, from XML to Class

Rdl.Report report = new Rdl.Report();
XmlSerializer serializer = new XmlSerializer(typeof(Report));
XmlNodeReader xmlr = new XmlNodeReader(xmldoc);
report = (Rdl.Report)serializer.Deserialize(xmlr);

Now you can change the report elements using the objects and collections inside the
Rdl.Report class.

And Serialization, from Class to XML:

XmlDocument xmldoc = new XmlDocument();
StringBuilder sb = new StringBuilder();
MyStringWriterWithEncoding sw = new MyStringWriterWithEncoding(sb, System.Text.Encoding.UTF8);
serializer.Serialize(sw, report);
string sxml = sb.ToString();
xmldoc.LoadXml(sxml);

Here is a link to the ReportDefinition.cs class: