Page 1 of 2

RTF print tables

Posted: Tue Apr 01, 2014 5:59 am
by MikaMikuMik
Hello, I meet up with some problems when printing tables in my reports: when I try to convert my table from flowdocument some rows at bottom of table is missing.

Rtf convert method:

Code: Select all

public static string ToRtf(this FlowDocument document)
        {
            var stream = new MemoryStream();
            document.GetDocumentRange().Save(stream, DataFormats.Rtf);

            var str = Encoding.Default.GetString(stream.GetBuffer());
            var encoded_str = XmlConvert.EncodeName(StiRichText.PackRtf(str));
            
            return encoded_str;
        }
I found this article about Riched20.dll on your knowlegebase:
http://support.stimulsoft.com/index.php ... -component

I try to connect new version of dll to my project but it fails with error: "wrong assembly manifest".

Re: RTF print tables

Posted: Tue Apr 01, 2014 9:05 am
by HighAley
Hello.

You don't need to connect Riched20.dll. It's enough to put it in the bin folder.
There is a new one in the Windows 8.1, please, try it.

Thank you.

Re: RTF print tables

Posted: Tue Apr 01, 2014 9:25 am
by MikaMikuMik
Yes, I put it in bin folder with other *.dll and *.exe files, and I got the same manifest error. Do I need some other file? (I try versions 6.0 and 8.0 from office 2010, 2013, they are bad too...)

I lookup riched20.dll in Win 8.1 in System32 and SysWOW64, there the same 3.1 version like in Win7.

Re: RTF print tables

Posted: Tue Apr 01, 2014 9:34 am
by HighAley
Hello.

Did you remove the Riched20.dll from Referenced Assemblies?

Thank you.

Re: RTF print tables

Posted: Tue Apr 01, 2014 9:37 am
by MikaMikuMik
I even can't add it to Project References.

Re: RTF print tables

Posted: Tue Apr 01, 2014 1:19 pm
by HighAley
Hello.
MikaMikuMik wrote:I even can't add it to Project References.
You should NOT add it to Project Reference.

Thank you.

Re: RTF print tables

Posted: Wed Apr 02, 2014 2:37 am
by MikaMikuMik
Okay, I'll show what I do:
Here's my dll: http://prntscr.com/3698t3
I put my dll here, where others dll: http://prntscr.com/3698y8
And then I get a manifest error:

Code: Select all

System.BadImageFormatException: Невозможно загрузить файл или сборку "RICHED20" или один из зависимых от них компонентов. Ожидалось, что модуль содержит манифест сборки.
Имя файла: "RICHED20"

Re: RTF print tables

Posted: Wed Apr 02, 2014 5:24 am
by HighAley
Hello.

Where do you get this error?
Please, look through all your solution for this string "RICHED20".
This exception is thrown when an unmanaged dynamic link library is passed to the Load method for loading.

Thank you.

Re: RTF print tables

Posted: Wed Apr 02, 2014 7:23 am
by MikaMikuMik
There is no "RICHED20" string in solution, only main cycle of class init which is doing work of loading *.dll from bin folder.

The error message comes from here: http://prntscr.com/36afcq

The ineresting thing is that when I make new clean project with:

Code: Select all

  <package id="Stimulsoft.Base" version="2014.1.1808.0" targetFramework="net45" />
  <package id="Stimulsoft.Controls" version="2014.1.1808.0" targetFramework="net45" />
  <package id="Stimulsoft.Controls.Win" version="2014.1.1808.0" targetFramework="net45" />
  <package id="Stimulsoft.Editor" version="2014.1.1808.0" targetFramework="net45" />
  <package id="Stimulsoft.Report" version="2014.1.1808.0" targetFramework="net45" />
  <package id="Stimulsoft.Report.Check" version="2014.1.1808.0" targetFramework="net45" />
  <package id="Stimulsoft.Report.Design" version="2014.1.1808.0" targetFramework="net45" />
  <package id="Stimulsoft.Report.Helper" version="2014.1.1808.0" targetFramework="net45" />
  <package id="Stimulsoft.Report.Win" version="2014.1.1808.0" targetFramework="net45" />
And put *.dll version 8.0 in bin folder, there is no error message and Process Exploere show that dll do loading riched20.dll from bin folder.

Re: RTF print tables

Posted: Thu Apr 03, 2014 6:48 am
by HighAley
Hello.

Could you specify do you get any error now?
In your previous message you wrote that error is thrown when you put riched20.dll in the bin folder.

Thank you.