Page 1 of 1

Modify Ranorex Report Format

Posted: Wed Mar 30, 2016 8:26 am
by vikram_u_k
Hi All,
the Link lists the changes in the StyleSheet for PDF reports.
http://www.ranorex.com/blog/ranorex-rep ... onversion/

it is required to add the User/Logged In User name in the PDF file.

Could any pointers be added on how to add this Information into the ReportToPDF() method.

Re: Modify Ranorex Report Format

Posted: Wed Mar 30, 2016 2:13 pm
by Martin

Code: Select all

string Username = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
or

Code: Select all

string Username = Environment.UserName;
If you're on a network the 1st one will return also the network name (e.g NetworkName\UserName)
Second one will return only the username.

From there on do what ever you like with the string value.

Edit: Also it seems that report files already contain the username by default in the "activity" tag (in .data file) so it's more or less displaying it.

You can achive this by adding the following code to the RanorexReport5.xsl or any other custom stylesheet:

Code: Select all

<td>
          <i class="field">
            User name <b>
              <xsl:value-of select="@user"/>
            </b>
          </i>
        </td>

Re: Modify Ranorex Report Format

Posted: Thu Mar 31, 2016 1:07 pm
by RobinHood42
Hi guys,

I'm afraid that you mixed something up here. It is not possible to log custom fields to the Ranorex PDF report. I guess if you want to add that as a feature request, you should contact [email protected] directly.

Hope this helps,
Robin