|
|
Iam trying to run a WPF Report Viewer(coding in vb).
But its giving the following error
"Report definition file can't be opened, error:\rObject reference not set to an instance of an object."
I have specified the OpenFileDialog.FileName also
But to no avail....
PLEASE HELLLP.....
Best Wishes ....... ARIJIT
|
|
|
|
|
You will need to set a breakpoint, and step over the code that's loading the report definition to find out which variable is null. Without seeing the code, there's no way that we can know.
|
|
|
|
|
I am giving the relevant code :
Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles button1.Click
Dim ofd As OpenFileDialog = New OpenFileDialog()
ofd.Title = "Select report definition file"
ofd.Filter = "Report definition files (*.xml)|*.xml|All files (*.*)|*.*"
If (ofd.ShowDialog() = System.Windows.Forms.DialogResult.OK) Then
Try
' parse file and select report definitions
Dim reports As String() = C1.C1Report.C1Report.GetReportList(ofd.FileName)
If (reports Is Nothing) Or (reports.Length <= 0) Then
Throw New Exception(String.Format("File {0} has no reports definitions.", ofd.FileName))
End If
tbFileName.Text = ofd.FileName
c1DocumentViewer.FileName = ofd.FileName
cbReportName.Items.Clear()
Dim reportName As String
For Each reportName In reports
cbReportName.Items.Add(reportName)
Next
cbReportName.SelectedIndex = 0
Catch ex As Exception
System.Windows.MessageBox.Show(String.Format("Report definition file can't be opened, error:\r{0}", ex.Message), "Error", MessageBoxButton.OK, MessageBoxImage.Error)
c1DocumentViewer.ReportName = ""
c1DocumentViewer.FileName = ""
End Try
End If
End Sub
Please help !
Best Wishes ....... ARIJIT
|
|
|
|
|
Hi.
I have recently started learning WPF. I've written a small app with a tab control on it. I have basically finished it and works fine. But here is the thing... why can't I select the tabs like I can in a normal windows app in the design mode so I can edit controls on that specific tab? I've tried Googling for an answer, but found nothing... which got me thinking that it's not a "general problem" and that I must be doing something wrong???
|
|
|
|
|
Clicking on a TabItem's tab in the design pane should move you to that TabItem's contents.
Also, placing the caret in a TabItem's XAML should move you to that TabItem's contents.
Maybe try it with this:
<TabControl>
<TabItem Header="Tab 1">
<TextBlock Text="Text 1"/>
</TabItem>
<TabItem Header="Tab 2">
<TextBlock Text="Text 2"/>
</TabItem>
<TabItem Header="Tab 3">
<TextBlock Text="Text 3"/>
</TabItem>
</TabControl>
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hello everyone!
I'll try to explain my trouble.
First, I have a LINQ To SQL class with two tables: Talleres and Areas. First table (Talleres) has a field called Area which contains an id of the Areas table, so there's the realtion Talleres.Area --> Area.Id defined at the database and, by extension, at the LINQ to SQL class.
Now, I want to make a form in WPF that presents two comboboxes. In combobox one (TalleresComboBox) there should show the list of Talleres (showing their property Name) and in combobox two (AreasComboBox) there should show the list of Areas (also showing their own property Name). There's also a SubmitButton to submit changes.
The behaviour of this form is very simple buy I can't be able to implement:
Point number 1. If we change the current element of TalleresComboBox, the element of AreasComboBox must autochange to the corresponding value.
Point number 2. We must be able to change the Area field of the Talleres element by changing the current item from AreasComboBox and updating database by pressing SubmitButton.
My code right now is the following:
C# Part
private void Window_Loaded(object sender, RoutedEventArgs e)
{
var Talleres = from row in dc.Talleres_talleres
select row;
TalleresComboBox.DataContext = Talleres;
var Areas = return from row in dc.Talleres_areas
select row;
AreasComboBox2.DataContext = Areas;
}
XAML Part
<Grid Height="354" Width="573">
<ComboBox ItemsSource="{Binding}"
DisplayMemberPath="name"
IsSynchronizedWithCurrentItem="True"
Margin="157,20,0,0" x:Name="TalleresComboBox" HorizontalAlignment="Left" VerticalAlignment="Top" Width="386" Height="23"/>
<ComboBox ItemsSource="{Binding}"
DisplayMemberPath="name"
SelectedValuePath="id"
SelectedValue="{Binding ElementName=TalleresComboBox, Path=SelectedItem.area, Mode=OneWay}"
Height="23" Margin="157,60,0,0" Name="comboBox2" VerticalAlignment="Top" HorizontalAlignment="Left" Width="386" />
<Button Height="23" HorizontalAlignment="Left" Margin="468,309,0,0" Name="button1" VerticalAlignment="Top" Width="75"
Click="button1_Click">Actualizar</Button>
</Grid>
I succedded in point number 1 but not point number 2. I've tried diferent things but no one has been ok.
Please help. Thanks very much.
|
|
|
|
|
Does anyone know of a component available similar to this one that ComponentArt's releasing next year: Click here[^]
It doesn't have to be silverlight exactly. An ajax component like this may work ok also (although I'd assume silverlight would be better for this).
Any ideas?
Thanks.
Regards,
-Goalie35
|
|
|
|
|
Try Zenexis:
http://www.zenexis.com/products/control/tabid/67/p-10-carousel.aspx
|
|
|
|
|
Hi.
Can we play a *.MP3 file in WPF (C#) ?
Any ideas ?
Thank you.
|
|
|
|
|
Mohammad Dayyan wrote: Can we play a *.MP3 file in WPF (C#) ?
Yes.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mohammad Dayyan wrote:
Can we play a *.MP3 file in WPF (C#) ?
Yes.
Mohammad Dayyan wrote: Any ideas ?
Maybe do a google search on it, or search the article search here.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
|
You could also use the MediaPlayer class to access Window Media Player directly through C#.
MediaPlayer _mp3Player = new MediaPlayer();
_mp3Player.Stop();
Uri mp3 = new Uri(mp3fileLocation);
_mp3Player.Open(mp3);
_mp3Player.Play();
|
|
|
|
|
I also use SoundPlayer class ( I tested it for *.wav files )
|
|
|
|
|
I need to send a dll file using WCF Service. Please Help me for do this
Dushan Perera
|
|
|
|
|
You could always transfer it as a stream of bytes.
|
|
|
|
|
can u please explain how to do it.
Dushan Perera
|
|
|
|
|
Off the top of my head, it might look something like this:
public class DllFile
{
[DataMember]
public string FileName;
[DataMember]
public byte[] File;
}
[ServiceContract]
public interface IDownload
{
[OperationContract]
DllFile DownloadFile();
}
public class Download : IDownload
{
public DllFile DownloadFile()
{
DllFile dllFile = new DllFile();
dllFile.FileName = <<fullyqualified filename.dll>>
using (FileStream fs = new FileStream(dllFile.FileName, FileMode.Open, FileAccess.Read))
{
dllFile.File = new byte[(int)fs.Length];
fs.Read(dllFile.File, 0, (int)fs.Length);
return dllFile;
}
}
}
|
|
|
|
|
Thanks pal.I check it and see
Dushan Perera
|
|
|
|
|
Thanks Pal. It works.
Dushan Perera
|
|
|
|
|
|
Hello everybody.
Do we have a class with TimeSpan? name in WPF ?
If so, what's that ?
Thank you.
|
|
|
|
|
This is a standard .NET type (the ? at the end means it's nullable). Basically, a TimeSpan is a representation of a period of time, and can be set up based on different intervals.
|
|
|
|
|
Thanks for Helping me Guys. i had a lot of Challenges in this and i solved them , but am still having a Problem,. Let me explain what i did So Far.
Step1:
I Prepared a a DeepZoom Project and it Created a Solution that has two Projects, the other one has a Folder(ClientBin) that has DeepZoomProject.xap and the other one has "App.xaml" and some Class Files that take care of mouse movement Zooming in my Project i suppose.
Step2: I created a New Solution(ASP.NET Application) in Different Directory and after that went to File-> Add Existing Project->And Went to the Solution that was created by DeepZoom. So it added both the Projects that i have explained above. That means in my Solution now i have 3 Projects.
Step3: I built the Solution and i got the Following Errors
Error 1 Library project file cannot specify ApplicationDefinition element. DeepZoomProject
Error 2 The project file contains a property value that is not valid. DeepZoomProject
Error 3 Cannot update project reference 'DeepZoomProject'. Failed to create the directory ClientBin|false. Unable to add folder 'ClientBin|false' to the Web site. Cannot create folder 'ClientBin|false'. The filename, directory name, or volume label syntax is incorrect.
C:\...\DeepZoomProjectWeb\
Now this Errors Originates from the Project that is Carrying the App.xaml. The other Project says Succeded after i buid them.
I have not yet Embeded the "DeepZoomProject.xap" File in the ASP.NET Page.
Please Help me with the Next Step, amyo You meantion certain tabs Steps, but in VS2008
Go Silverlight Application tab, In the Project Properties there is no Silverlight Tab . Inn the StartOption in the Project Properties there is a Checkbox for Silverlight. i have chacked that.
Thank you
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|