Printg problem at flowDocument's inner checkbox - wpf

I wonder whether this is right way to print flowdocument :(
but this is a very strange phenomenon.
My Code like this:
string flowDocString =
" <FlowDocument xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'>" +
" <Section>" +
" <Paragraph>" +
" <CheckBox IsChecked='True'>Test</CheckBox>" +
" </Paragraph>" +
" </Section>" +
" </FlowDocument>";
FlowDocument flowDoc = (FlowDocument)XamlReader.Load(new MemoryStream(new UTF8Encoding().GetBytes(flowDocString)));
PrintDialog printDlg = new PrintDialog();
IDocumentPaginatorSource idpSource = flowDoc;
printDlg.PrintDocument(idpSource.DocumentPaginator, "Hello WPF Printing.");
When I use this code, the checkbox's state is still unchecked.
But when I modify the flowDocString like this:
string flowDocString =
" <FlowDocument xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'>" +
" <Section>" +
" <Paragraph>" +
" <CheckBox IsChecked='True' IsEnabled='False'>Test</CheckBox>" +
" </Paragraph>" +
" </Section>" +
" </FlowDocument>";
If you modify the above results will be displayed as intended.
How can this happened? Please tell me why.

Related

H2 - Field must be in group by list

i get the following exception: Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Field "RECHNUNGEN0_.GRUPPEN_RECHNUNGSJAHR" must be in GROUP BY List
can someone explain whats wrong in the query?
#Query("Select new de.company.jpa.model.RechnungsjahrUndNummerVO(" +
"r.gruppenRechnungsjahr, " +
"r.gruppenRechnungsnummer) " +
"From RechnungEntity r " +
"Where (:vermittlungsnummern is null or r.vermittlungsnummer in :vermittlungsnummern) " +
"and (:statusklassen is null or r.statusklasse in :statusklassen) " +
"and (:gruppenOm is null or r.gruppenOm = :gruppenOm)" +
"group by r.gruppenRechnungsnummer " +
"order by r.gruppenRechnungsjahr")
List<RechnungsjahrUndNummerVO> findRechnungsjahrUndNummernByVermittlungsnummernStatusklasseGruppenOm(List<String> vermittlungsnummern,
List<String> statusklassen,
String gruppenOm);

Change font weight in a WPF label only for some parts

I have a calculator and the results are shown in a label. Is it possible to set the result values (some string, some double) to display in bold?
My code looks like this:
...{
label2.Content = "your time: " + saldoMin +
" and: " + fooNeg +
" " + inH +
" : " + inMin +
" [h : min]\nyour factor: " + YourFactor +
"\n\ngo at: " + beginnH +
" : " + fooNull;
}
and I only want the objects saldoMin, fooNeg, inH, ... to be bold, but not the code behind.
You can use a TextBlock with Runs. Here is an example:
var text = new TextBlock();
text.Inlines.Add(new Bold(new Run("Bold:")));
text.Inlines.Add(new Run(" nonbold"));
label2.Content = text;

how to click on javascript element in selenium

52 Low
This is how the html part is coded by developer
In case the ID of the link (tab) is not changing then you should put:
((JavascriptExecutor)driver).executeScript("document.getElementById('tab8').click()");
or even simplier (as Vivek noted):
((JavascriptExecutor)driver).findElement(By.id('tab8')).click();
In case the ID of the tab could potentially change you could search it by its text:
((JavascriptExecutor)driver).executeScript(
"var tabs= document.getElementsByTagName("a");" +
"var tabText= "52 Low";" +
"for (var i = 0; i < tabs.length; i++) {" +
" if (tabs[i].textContent == tabText) {" +
" tabs[i].click();" +
" break;" +
" }" +
"}");

Split character Reporting Service (Character "ENTER")

i had one row from database
when i view this data on reporting service i get view:
baris 1
baris 2
i want to change view on reporting service to be
baris 1
baris 2
anyone can help please?
I would use a combination of the Split function with the constant: Constants.vbCrLf. In your scenario the Split might be tricky - there's no obvious delimiter to split on.
This example might get you started:
= "1. " + Split ( Fields!my_column.Value , " " )(0) + " " + Split ( Fields!my_column.Value , " " )(1)
+ Constants.vbCrLf
+ "2. " + Split ( Fields!my_column.Value , " " )(2) + " " + Split ( Fields!my_column.Value , " " )(3)

How to read msExchMailboxSecurityDescriptor attribute in C#

I am trying to read all the user attributes in AD.
How to read msExchMailboxSecurityDescriptor attribute in C# ?
I used the following code but I got a cast error. Any suggestions would be welcome.
DirectoryObjectSecurity oSec = new ActiveDirectorySecurity();
oSec.SetSecurityDescriptorBinaryForm((byte[])val);
String m_Value = oSec.GetSecurityDescriptorSddlForm(AccessControlSections.All);
return m_Value;
Ok. I was able to figure it out. The code is given below for anyone interested. I wish Microsoft had put out some code samples so that people do not have to break their heads.
SecurityDescriptor sd = (SecurityDescriptor) p_InputValue;
AccessControlList acl = (AccessControlList)sd.DiscretionaryAcl;
String m_Trustee = "";
String m_AccessMask = "";
String m_AceType = "";
String m_ReturnValue="";
foreach (AccessControlEntry ace in (IEnumerable)acl)
{
m_Trustee = m_Trustee + "," + ace.Trustee;
m_AccessMask = m_AccessMask + "," + ace.AccessMask.ToString();
m_AceType = m_AceType + "," +ace.AceType.ToString();
}
m_ReturnValue="Trustee: " + m_Trustee + " " + "AccessMask: " + m_AccessMask + "AceType: " + m_AceType;
return m_ReturnValue

Resources